Improve logging

This commit is contained in:
darken
2022-02-10 13:09:45 +01:00
parent 6b02fd66e6
commit 568aeec0d5
2 changed files with 2 additions and 0 deletions
@@ -33,6 +33,7 @@ class BleScanner @Inject constructor(
scannerMode: ScannerMode,
compatMode: Boolean,
): Flow<List<BleScanResult>> = callbackFlow {
log(TAG, VERBOSE) { "scan(filters=$filters, scannerMode=$scannerMode, compatMode=$compatMode)" }
if (compatMode) log(TAG, WARN) { "Using compatibilityMode!" }
val adapter = bluetoothManager.adapter
@@ -66,6 +66,7 @@ class PodMonitor @Inject constructor(
) { scannerMode, compatMode, unfiltered ->
Triple(scannerMode, compatMode, unfiltered)
}.flatMapLatest { (mode, compat, unfiltered) ->
log(TAG, VERBOSE) { "Starting BLEScanner mode=$mode, compat=$compat, unfiltered=$unfiltered" }
val filters = if (unfiltered) {
setOf(getUnfilteredFilter())
} else {