diff --git a/LittleBlueTooth.xcodeproj/project.pbxproj b/LittleBlueTooth.xcodeproj/project.pbxproj index ce717d1..d43fc54 100644 --- a/LittleBlueTooth.xcodeproj/project.pbxproj +++ b/LittleBlueTooth.xcodeproj/project.pbxproj @@ -52,6 +52,8 @@ 65AD4BE324D437B700C0CBE6 /* CoreBluetoothTypeAliases.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_28 /* CoreBluetoothTypeAliases.swift */; }; 65AD4BE424D437B700C0CBE6 /* LittleBlueTooth.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_29 /* LittleBlueTooth.swift */; }; 65AD4BF024D438AD00C0CBE6 /* LittleBlueToothForTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65AD4BEB24D437B700C0CBE6 /* LittleBlueToothForTest.framework */; }; + 65B7D53D25C3E01300556409 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B7D53C25C3E01300556409 /* Log.swift */; }; + 65B7D53E25C3E01300556409 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B7D53C25C3E01300556409 /* Log.swift */; }; 65BA2D0F24CDDE99008B4BD7 /* LittleBluetoothConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BA2D0E24CDDE99008B4BD7 /* LittleBluetoothConfiguration.swift */; }; 65ED540124D85EFC00558C2C /* CoreBluetoothMock in Frameworks */ = {isa = PBXBuildFile; productRef = 65ED540024D85EFC00558C2C /* CoreBluetoothMock */; }; 65F63EDF24F8EA73000E3474 /* JustLittleBlueTooth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F63EDE24F8EA73000E3474 /* JustLittleBlueTooth.swift */; }; @@ -112,6 +114,7 @@ 65A6B34F24DD29000068FE1C /* Loggable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Loggable.swift; sourceTree = ""; }; 65AD4BEB24D437B700C0CBE6 /* LittleBlueToothForTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LittleBlueToothForTest.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65AD4BEC24D437B700C0CBE6 /* LittleBlueTooth copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "LittleBlueTooth copy-Info.plist"; path = "/Users/Andrea/Documents/GitHub/LittleBlueTooth/LittleBlueTooth copy-Info.plist"; sourceTree = ""; }; + 65B7D53C25C3E01300556409 /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; 65BA2D0E24CDDE99008B4BD7 /* LittleBluetoothConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LittleBluetoothConfiguration.swift; sourceTree = ""; }; 65F63EDE24F8EA73000E3474 /* JustLittleBlueTooth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JustLittleBlueTooth.swift; sourceTree = ""; }; "LittleBlueTooth::LittleBlueTooth::Product" /* LittleBlueTooth.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LittleBlueTooth.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -187,6 +190,7 @@ 650F378824F6B9B600C35395 /* ReadAndWrite.swift */, 650F378D24F6C33200C35395 /* Listen.swift */, 65F63EDE24F8EA73000E3474 /* JustLittleBlueTooth.swift */, + 65B7D53C25C3E01300556409 /* Log.swift */, ); path = CustomOperator; sourceTree = ""; @@ -481,6 +485,7 @@ files = ( 65AD4BD624D437B700C0CBE6 /* LittleBlueToothError.swift in Sources */, 65F63EE024F8ED8E000E3474 /* JustLittleBlueTooth.swift in Sources */, + 65B7D53E25C3E01300556409 /* Log.swift in Sources */, 6574671724F684E600E08B47 /* ScanAndConnection.swift in Sources */, 65F63EE424F9216A000E3474 /* ReplaySubject.swift in Sources */, 65AD4BD724D437B700C0CBE6 /* AdvertisingData.swift in Sources */, @@ -509,6 +514,7 @@ files = ( OBJ_52 /* LittleBlueToothError.swift in Sources */, 65F63EDF24F8EA73000E3474 /* JustLittleBlueTooth.swift in Sources */, + 65B7D53D25C3E01300556409 /* Log.swift in Sources */, 6574671624F631F700E08B47 /* ScanAndConnection.swift in Sources */, 65F63EE324F92169000E3474 /* ReplaySubject.swift in Sources */, OBJ_53 /* AdvertisingData.swift in Sources */, @@ -645,7 +651,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.6.1; + MARKETING_VERSION = 0.6.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited) -DTEST"; @@ -736,7 +742,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.6.0; + MARKETING_VERSION = 0.6.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; @@ -770,7 +776,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.6.0; + MARKETING_VERSION = 0.6.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited) -DTEST"; @@ -804,7 +810,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.6.0; + MARKETING_VERSION = 0.6.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; @@ -945,7 +951,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.6.1; + MARKETING_VERSION = 0.6.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; @@ -979,7 +985,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.6.1; + MARKETING_VERSION = 0.6.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; diff --git a/Sources/LittleBlueTooth/Classes/CustomOperator/Log.swift b/Sources/LittleBlueTooth/Classes/CustomOperator/Log.swift new file mode 100644 index 0000000..f040d88 --- /dev/null +++ b/Sources/LittleBlueTooth/Classes/CustomOperator/Log.swift @@ -0,0 +1,18 @@ +// +// Log.swift +// LittleBlueTooth +// +// Created by Andrea Finollo on 29/01/21. +// + +import Foundation +import Combine + +extension Publisher { + func customPrint(_ prefix: String = "", to: TextOutputStream? = nil, isEnabled: Bool = true) -> AnyPublisher { + if isEnabled { + return print(prefix, to: to).eraseToAnyPublisher() + } + return AnyPublisher(self) + } +} diff --git a/Sources/LittleBlueTooth/Classes/Model/Peripheral.swift b/Sources/LittleBlueTooth/Classes/Model/Peripheral.swift index c4fe46f..bd83ac9 100644 --- a/Sources/LittleBlueTooth/Classes/Model/Peripheral.swift +++ b/Sources/LittleBlueTooth/Classes/Model/Peripheral.swift @@ -165,12 +165,12 @@ public class Peripheral: Identifiable { fileprivate func discoverCharacteristic(_ charateristicUUID: CBUUID, fromService serviceUUID: CBUUID) -> AnyPublisher { let discovery = self.getService(serviceUUID: serviceUUID) - .print("Discover service") + .customPrint("[LBT] Discover service", isEnabled: isLogEnabled) .flatMap { services -> AnyPublisher in let service = services!.filter{ $0.uuid == serviceUUID}.first! return self.getCharateristic(characteristicUUID: charateristicUUID, from: service) } - .print("Discover characteristic") + .customPrint("[LBT] Discover characteristic", isEnabled: isLogEnabled) .tryMap { (service) -> CBCharacteristic in guard let charact = service.characteristics?.filter({ $0.uuid == charateristicUUID}).first else { throw LittleBluetoothError.characteristicNotFound(nil) diff --git a/Sources/LittleBlueTooth/Classes/Proxies/CBCentralManagerDelegateProxy.swift b/Sources/LittleBlueTooth/Classes/Proxies/CBCentralManagerDelegateProxy.swift index c9d642c..2667f45 100644 --- a/Sources/LittleBlueTooth/Classes/Proxies/CBCentralManagerDelegateProxy.swift +++ b/Sources/LittleBlueTooth/Classes/Proxies/CBCentralManagerDelegateProxy.swift @@ -84,7 +84,7 @@ class CBCentralManagerDelegateProxy: NSObject { extension CBCentralManagerDelegateProxy: CBCentralManagerDelegate { func centralManagerDidUpdateState(_ central: CBCentralManager) { - log("CBCMD DidUpdateState %{public}d", + log("[LBT: CBCMD] DidUpdateState %{public}d", log: OSLog.LittleBT_Log_CentralManager, type: .debug, arg: central.state.rawValue) @@ -93,7 +93,7 @@ extension CBCentralManagerDelegateProxy: CBCentralManagerDelegate { /// Scan func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) { - log("CBCMD DidDiscover %{public}@", + log("[LBT: CBCMD] DidDiscover %{public}@", log: OSLog.LittleBT_Log_CentralManager, type: .debug, arg: peripheral.description) @@ -103,7 +103,7 @@ extension CBCentralManagerDelegateProxy: CBCentralManagerDelegate { /// Monitoring connection func centralManager(_ central: CBCentralManager, didConnect: CBPeripheral) { - log("CBCMD DidConnect %{public}@", + log("[LBT: CBCMD] DidConnect %{public}@", log: OSLog.LittleBT_Log_CentralManager, type: .debug, arg: didConnect.description) @@ -118,7 +118,7 @@ extension CBCentralManagerDelegateProxy: CBCentralManagerDelegate { } func centralManager(_ central: CBCentralManager, didDisconnectPeripheral: CBPeripheral, error: Error?) { - log("CBCMD DidDisconnect %{public}@, Error %{public}@", + log("[LBT: CBCMD] DidDisconnect %{public}@, Error %{public}@", log: OSLog.LittleBT_Log_CentralManager, type: .debug, arg: didDisconnectPeripheral.description, @@ -143,7 +143,7 @@ extension CBCentralManagerDelegateProxy: CBCentralManagerDelegate { } func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) { - log("CBCMD WillRestoreState %{public}@", + log("[LBT: CBCMD] WillRestoreState %{public}@", log: OSLog.LittleBT_Log_Restore, type: .debug, arg: dict.description) diff --git a/Sources/LittleBlueTooth/Classes/Proxies/CBPeripheralProxy.swift b/Sources/LittleBlueTooth/Classes/Proxies/CBPeripheralProxy.swift index f011003..0571acf 100644 --- a/Sources/LittleBlueTooth/Classes/Proxies/CBPeripheralProxy.swift +++ b/Sources/LittleBlueTooth/Classes/Proxies/CBPeripheralProxy.swift @@ -42,14 +42,14 @@ class CBPeripheralDelegateProxy: NSObject { extension CBPeripheralDelegateProxy: CBPeripheralDelegate { func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral){ - log("CBPD ReadyToSendWRiteWOResp", + log("[LBT: CBPD] ReadyToSendWRiteWOResp", log: OSLog.LittleBT_Log_Peripheral, type: .debug) peripheralIsReadyToSendWriteWithoutResponse.send() } func peripheralDidUpdateName(_ peripheral: CBPeripheral) { - log("CBPD DidUpdateName %{public}@", + log("[LBT: CBPD] DidUpdateName %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: peripheral.name ?? "na") @@ -57,7 +57,7 @@ extension CBPeripheralDelegateProxy: CBPeripheralDelegate { } func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]){ - log("CBPD DidModifyServices %{public}@", + log("[LBT: CBPD] DidModifyServices %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: invalidatedServices.description) @@ -73,7 +73,7 @@ extension CBPeripheralDelegateProxy: CBPeripheralDelegate { } func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?){ - log("CBPD DidDiscoverServices, Error %{public}@", + log("[LBT: CBPD] DidDiscoverServices, Error %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: error?.localizedDescription ?? "") @@ -85,7 +85,7 @@ extension CBPeripheralDelegateProxy: CBPeripheralDelegate { } func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) { - log("CBPD DidDiscoverIncludedServices %{public}@, Error %{public}@", + log("[LBT: CBPD] DidDiscoverIncludedServices %{public}@, Error %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: service.description, @@ -98,7 +98,7 @@ extension CBPeripheralDelegateProxy: CBPeripheralDelegate { } func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?){ - log("CBPD DidDiscoverCharacteristic %{public}@, Error %{public}@", + log("[LBT: CBPD] DidDiscoverCharacteristic %{public}@, Error %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: service.description, @@ -111,7 +111,7 @@ extension CBPeripheralDelegateProxy: CBPeripheralDelegate { } func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?){ - log("CBPD DidUpdateValue %{public}@, Error %{public}@", + log("[LBT: CBPD] DidUpdateValue %{public}@, Error %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: characteristic.description, @@ -128,7 +128,7 @@ extension CBPeripheralDelegateProxy: CBPeripheralDelegate { } func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) { - log("CBPD DidWriteValue %{public}@, Error %{public}@", + log("[LBT: CBPD] DidWriteValue %{public}@, Error %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: characteristic.description, @@ -141,7 +141,7 @@ extension CBPeripheralDelegateProxy: CBPeripheralDelegate { } func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?){ - log("CBPD DidUpdateNotifState %{public}@, Error %{public}@", + log("[LBT: CBPD] DidUpdateNotifState %{public}@, Error %{public}@", log: OSLog.LittleBT_Log_Peripheral, type: .debug, arg: characteristic.description, diff --git a/Sources/LittleBlueTooth/LittleBlueTooth.swift b/Sources/LittleBlueTooth/LittleBlueTooth.swift index 17fe7f9..db53466 100644 --- a/Sources/LittleBlueTooth/LittleBlueTooth.swift +++ b/Sources/LittleBlueTooth/LittleBlueTooth.swift @@ -193,7 +193,7 @@ public class LittleBlueTooth: Identifiable { attachSubscribers(with: configuration.restoreHandler) self.isLogEnabled = configuration.isLogEnabled log( - "LBT init options %{public}@", + "[LBT] init options %{public}@", log: OSLog.LittleBT_Log_General, type: .debug, arg: configuration.centralManagerOptions?.description ?? "" @@ -204,7 +204,7 @@ public class LittleBlueTooth: Identifiable { self.connectionEventSubscriber = connectionEventPublisher .flatMap { [unowned self] (event) -> AnyPublisher in - print("Received event \(event)") +// print("Received event \(event)") switch event { case .connected(let periph), .autoConnected(let periph): @@ -241,7 +241,7 @@ public class LittleBlueTooth: Identifiable { // This delay to make able other subscribers to receive notification .delay(for: .milliseconds(50), scheduler: DispatchQueue.main) .sink { [unowned self] (event) in - print("Sinking event \(event)") +// print("Sinking event \(event)") if case ConnectionEvent.disconnected( let peripheral, let error) = event { self.cleanUpForDisconnection() if let autoCon = self.autoconnectionHandler, let er = error { @@ -284,7 +284,7 @@ public class LittleBlueTooth: Identifiable { let key = UUID() self.ensureBluetoothState() - .print("Read RSSI") + .customPrint("[LBT] Read RSSI", isEnabled: isLogEnabled) .flatMap { [unowned self] _ in self.ensurePeripheralReady() } @@ -319,7 +319,7 @@ public class LittleBlueTooth: Identifiable { public func connectableListenPublisher(for characteristic: LittleBlueToothCharacteristic, valueType: T.Type) -> Publishers.MakeConnectable> { let listen = ensureBluetoothState() - .print("ConnectableListenPublisher") + .customPrint("[LBT] ConnectableListenPublisher", isEnabled: isLogEnabled) .flatMap { [unowned self] _ in self.ensurePeripheralReady() } @@ -360,7 +360,7 @@ public class LittleBlueTooth: Identifiable { /// - important: The type of the value must be conform to `Readable` public func startListen(from charact: LittleBlueToothCharacteristic) -> AnyPublisher { let lis = ensureBluetoothState() - .print("StartListenPublisher") + .customPrint("[LBT] StartListenPublisher", isEnabled: isLogEnabled) .flatMap { [unowned self] _ in self.ensurePeripheralReady() } @@ -405,7 +405,7 @@ public class LittleBlueTooth: Identifiable { let key = UUID() self.ensureBluetoothState() - .print("StartListenPublisher no Value") + .customPrint("[LBT] StartListenPublisher no Value", isEnabled: isLogEnabled) .flatMap { [unowned self] _ in self.ensurePeripheralReady() } @@ -476,7 +476,7 @@ public class LittleBlueTooth: Identifiable { let key = UUID() ensureBluetoothState() - .print("ReadPublisher") + .customPrint("[LBT] ReadPublisher", isEnabled: isLogEnabled) .flatMap { [unowned self] _ in self.ensurePeripheralReady() } @@ -528,7 +528,7 @@ public class LittleBlueTooth: Identifiable { let key = UUID() ensureBluetoothState() - .print("WritePublisher") + .customPrint("[LBT] WritePublisher", isEnabled: isLogEnabled) .flatMap { [unowned self] _ in self.ensurePeripheralReady() } @@ -565,7 +565,7 @@ public class LittleBlueTooth: Identifiable { let key = UUID() ensureBluetoothState() - .print("WriteAndListePublisher") + .customPrint("[LBT] WriteAndListePublisher", isEnabled: isLogEnabled) .flatMap { [unowned self] _ in self.ensurePeripheralReady() } @@ -617,7 +617,7 @@ public class LittleBlueTooth: Identifiable { scanning = ensureBluetoothState() - .print("DiscoverPublisher") + .customPrint("[LBT] DiscoverPublisher", isEnabled: isLogEnabled) .map { [unowned self] _ -> Void in if self.cbCentral.isScanning { self.cbCentral.stopScan() @@ -690,7 +690,7 @@ public class LittleBlueTooth: Identifiable { let key = UUID() ensureBluetoothState() - .print("ConnectPublisher") + .customPrint("[LBT] ConnectPublisher", isEnabled: isLogEnabled) .tryMap { [unowned self] _ -> Void in let filtered = self.cbCentral.retrievePeripherals(withIdentifiers: [peripheralIdentifier.id]).filter { (periph) -> Bool in periph.identifier == peripheralIdentifier.id @@ -711,7 +711,7 @@ public class LittleBlueTooth: Identifiable { self.centralProxy.connectionEventPublisher.setFailureType(to: LittleBluetoothError.self) } .filter{ (event) -> Bool in - print("Connct to event: \(event)") +// print("Connct to event: \(event)") switch event { case .connected( _), .autoConnected( _): @@ -789,7 +789,7 @@ public class LittleBlueTooth: Identifiable { let key = UUID() self.centralProxy.connectionEventPublisher - .print("DisconnectPublisher") + .customPrint("[LBT] DisconnectPublisher", isEnabled: isLogEnabled) .filter{ (event) -> Bool in if case ConnectionEvent.disconnected(_, error: _) = event { return true @@ -848,7 +848,7 @@ public class LittleBlueTooth: Identifiable { let restoreDiscoverServices = restorer.services let restoreScanOptions = restorer.scanOptions let restoreDiscoveryPublisher = self.startDiscovery(withServices: restoreDiscoverServices, options: restoreScanOptions) - log("LBT Scan restore %{public}@", + log("[LBT] Scan restore %{public}@", log: OSLog.LittleBT_Log_Restore, type: .debug, arg: restorer.centralManager.isScanning ? "true" : "false") @@ -881,7 +881,7 @@ public class LittleBlueTooth: Identifiable { @unknown default: fatalError("Connection event in default not handled") } - log("LBT Periph restore %{public}@, has delegate: %{public}@ state %{public}d", + log("[LBT] Periph restore %{public}@, has delegate: %{public}@ state %{public}d", log: OSLog.LittleBT_Log_Restore, type: .debug, arg: cbPeripheral.description, @@ -898,7 +898,7 @@ public class LittleBlueTooth: Identifiable { let future = Deferred { Future { [unowned self] prom in self.centralProxy.centralStatePublisher - .print("CentralStatePublisher") + .customPrint("[LBT] CentralStatePublisher", isEnabled: isLogEnabled) .tryFilter { [unowned self] (state) -> Bool in switch state { case .poweredOff: @@ -921,7 +921,7 @@ public class LittleBlueTooth: Identifiable { error as! LittleBluetoothError } .map { state -> BluetoothState in - print("CBManager state: \(state)") +// print("CBManager state: \(state)") return state } .sink(receiveCompletion: { [unowned self, futKey] (completion) in @@ -950,7 +950,7 @@ public class LittleBlueTooth: Identifiable { } return self.centralProxy.connectionEventPublisher - .print("EnsurePeripheralReadyPublisher") + .customPrint("[LBT] EnsurePeripheralReadyPublisher", isEnabled: isLogEnabled) .tryFilter { (event) -> Bool in switch event { case .disconnected(_, let error?): diff --git a/Tests/LittleBlueToothTests/ConnectionTest.swift b/Tests/LittleBlueToothTests/ConnectionTest.swift index 9fb4338..bb7fd5b 100644 --- a/Tests/LittleBlueToothTests/ConnectionTest.swift +++ b/Tests/LittleBlueToothTests/ConnectionTest.swift @@ -16,7 +16,9 @@ class ConnectionTest: LittleBlueToothTests { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. try super.setUpWithError() - littleBT = LittleBlueTooth(with: LittleBluetoothConfiguration()) + var configuration = LittleBluetoothConfiguration() + configuration.isLogEnabled = true + littleBT = LittleBlueTooth(with: configuration) } override func tearDownWithError() throws {