停止记录 Android 信标库

Stop logging of Android Beacon Library

我试图阻止 Android 信标库的调试,但它不起作用。

我的gradle里有这个:

compile 'org.altbeacon:android-beacon-library:2.3.3'

我试过了:

public BeaconManager(Context ctx, org.altbeacon.beacon.BeaconManager beaconManager) {
    mContext = ctx;
    this.beaconManager = beaconManager;


    // this is saying deprecated
    this.beaconManager.setDebug(false);

    // I also tried this and the same thing
    org.altbeacon.beacon.logging.LogManager.setVerboseLoggingEnabled(false);

但无论如何,我一直在收到这些日志。他们开始调试其他东西。

02-18 16:21:29.784 31809-31818/com.myapp D/ScanRecord: first manudata for manu ID
02-18 16:21:29.784 31809-31818/com.myapp D/BluetoothLeScanner: onScanResult() - ScanResult{mDevice=45:0A:1B:49:64:7F, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=[f41ef1ee-fde5-23be-5f4b-589c71babfdd], mManufacturerSpecificData={76=[2, 21, 97, 104, 113, 9, -112, 95, 68, 54, -111, -8, -26, 2, -11, 20, -55, 109, 0, 3, 17, -71, -89]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=BC Beacon�], mRssi=-106, mTimestampNanos=284946077119796}

有什么线索吗?

使用以下正则表达式创建您自己的日志标签过滤器:

^(?!.*(ScanRecord)).*$

它将删除其中包含 "ScanRecord" 的所有行,如果需要,您可以通过执行 (ScanRecord|BluetoothLeScanner) 添加更多