diff --git a/Sources/KukaiCoreSwift/Clients/TezosNodeClient.swift b/Sources/KukaiCoreSwift/Clients/TezosNodeClient.swift index 8acb3c6d..e5cb43b4 100644 --- a/Sources/KukaiCoreSwift/Clients/TezosNodeClient.swift +++ b/Sources/KukaiCoreSwift/Clients/TezosNodeClient.swift @@ -317,7 +317,7 @@ public class TezosNodeClient { dispatchGroup.enter() dexterQueriesQueue.async { [weak self] in guard let url = self?.config.primaryNodeURL else { - os_log(.debug, log: .kukaiCoreSwift, "Invalid server url: %@", self?.config.primaryNodeURL.absoluteString ?? "nil") + os_log(.default, log: .kukaiCoreSwift, "Invalid server url: %@", self?.config.primaryNodeURL.absoluteString ?? "nil") completion(false, KukaiError.internalApplicationError(error: NetworkService.NetworkError.invalidURL)) return } @@ -338,7 +338,7 @@ public class TezosNodeClient { dispatchGroup.enter() dexterQueriesQueue.async { [weak self] in guard let url = self?.config.primaryNodeURL else { - os_log(.debug, log: .kukaiCoreSwift, "Invalid server url: %@", self?.config.primaryNodeURL.absoluteString ?? "nil") + os_log(.default, log: .kukaiCoreSwift, "Invalid server url: %@", self?.config.primaryNodeURL.absoluteString ?? "nil") completion(false, KukaiError.internalApplicationError(error: NetworkService.NetworkError.invalidURL)) return } diff --git a/Sources/KukaiCoreSwift/Clients/TzKTClient.swift b/Sources/KukaiCoreSwift/Clients/TzKTClient.swift index 4a852c50..5cd55113 100644 --- a/Sources/KukaiCoreSwift/Clients/TzKTClient.swift +++ b/Sources/KukaiCoreSwift/Clients/TzKTClient.swift @@ -641,7 +641,7 @@ public class TzKTClient { signalrConnection?.on(method: "accounts", callback: { [weak self] argumentExtractor in do { let obj = try argumentExtractor.getArgument(type: AccountSubscriptionResponse.self) - os_log("Incoming object parsed: %@", log: .tzkt, type: .debug, "\(obj)") + os_log("Incoming object parsed: %@", log: .tzkt, type: .default, "\(obj)") if let data = obj.data { var changedAddress: [String] = [] @@ -667,7 +667,7 @@ public class TzKTClient { Close the websocket from `listenForAccountChanges` */ public func stopListeningForAccountChanges() { - os_log(.debug, log: .kukaiCoreSwift, "Cancelling listenForAccountChanges") + os_log(.default, log: .kukaiCoreSwift, "Cancelling listenForAccountChanges") signalrConnection?.stop() isListening = false } @@ -1098,13 +1098,13 @@ extension TzKTClient: HubConnectionDelegate { os_log("Subscribe to account changes failed: %@", log: .tzkt, type: .error, "\(error)") self?.signalrConnection?.stop() } else { - os_log("Subscribe to account changes succeeded, waiting for objects", log: .tzkt, type: .debug) + os_log("Subscribe to account changes succeeded, waiting for objects", log: .tzkt, type: .default) } } } public func connectionDidClose(error: Error?) { - os_log("SignalR connection closed: %@", log: .tzkt, type: .debug, String(describing: error)) + os_log("SignalR connection closed: %@", log: .tzkt, type: .default, String(describing: error)) if newAddressesToWatch.count > 0 { self.listenForAccountChanges(addresses: newAddressesToWatch) diff --git a/Sources/KukaiCoreSwift/Services/DiskService.swift b/Sources/KukaiCoreSwift/Services/DiskService.swift index f9df5755..fab1236a 100644 --- a/Sources/KukaiCoreSwift/Services/DiskService.swift +++ b/Sources/KukaiCoreSwift/Services/DiskService.swift @@ -38,7 +38,7 @@ public class DiskService { do { try data.write(to: fileURL) - os_log(.debug, log: .kukaiCoreSwift, "Serialised encodable to: %@", toFileName) + os_log(.default, log: .kukaiCoreSwift, "Serialised encodable to: %@", toFileName) return true } catch (let error) { diff --git a/Sources/KukaiCoreSwift/Services/LedgerService.swift b/Sources/KukaiCoreSwift/Services/LedgerService.swift index 8d6af0c1..8dce8ba0 100644 --- a/Sources/KukaiCoreSwift/Services/LedgerService.swift +++ b/Sources/KukaiCoreSwift/Services/LedgerService.swift @@ -177,7 +177,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele // Register a native function, to be passed into the js functions, that will write chunks of data to the device let nativeWriteHandler: @convention(block) (String, Int) -> Void = { [weak self] (apdu, expectedNumberOfAPDUs) in - os_log("Inside nativeWriteHandler", log: .ledger, type: .debug) + os_log("Inside nativeWriteHandler", log: .ledger, type: .default) // Keep track of the number of times its called for each request self?.counter += 1 @@ -358,7 +358,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele /// CBCentralManagerDelegate function, must be marked public because of protocol definition public func centralManagerDidUpdateState(_ central: CBCentralManager) { - os_log("centralManagerDidUpdateState", log: .ledger, type: .debug) + os_log("centralManagerDidUpdateState", log: .ledger, type: .default) self.bluetoothSetup = (central.state == .poweredOn) } @@ -367,7 +367,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele // If we have been requested to connect to a speicific UUID, only listen for that one and connect immediately if found if let requested = self.requestedUUID, peripheral.identifier.uuidString == requested { - os_log("Found requested ledger UUID, connecting ...", log: .ledger, type: .debug) + os_log("Found requested ledger UUID, connecting ...", log: .ledger, type: .default) self.connectedDevice = peripheral self.centralManager?.connect(peripheral, options: ["requestMTU": 156]) @@ -375,7 +375,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele // Else if we haven't been requested to find a specific one, store each unique device and fire a delegate callback, until scan stopped manually } else if self.requestedUUID == nil, deviceList[peripheral.identifier.uuidString] == nil { - os_log("Found a new ledger device. Name: %@, UUID: %@", log: .ledger, type: .debug, peripheral.name ?? "-", peripheral.identifier.uuidString) + os_log("Found a new ledger device. Name: %@, UUID: %@", log: .ledger, type: .default, peripheral.name ?? "-", peripheral.identifier.uuidString) self.deviceList[peripheral.identifier.uuidString] = peripheral.name ?? "" } @@ -383,7 +383,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele /// CBCentralManagerDelegate function, must be marked public because of protocol definition public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) { - os_log("Connected to %@, %@", log: .ledger, type: .debug, peripheral.name ?? "", peripheral.identifier.uuidString) + os_log("Connected to %@, %@", log: .ledger, type: .default, peripheral.name ?? "", peripheral.identifier.uuidString) // record the connected device and set LedgerService as the delegate. Don't report successfully connected to ledgerService.delegate until // we have received the callbacks for services and characteristics. Otherwise we can't use the device @@ -394,7 +394,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele /// CBCentralManagerDelegate function, must be marked public because of protocol definition public func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) { - os_log("Failed to connect to %@, %@", log: .ledger, type: .debug, peripheral.name ?? "", peripheral.identifier.uuidString) + os_log("Failed to connect to %@, %@", log: .ledger, type: .default, peripheral.name ?? "", peripheral.identifier.uuidString) self.connectedDevice = nil self.deviceConnectedPublisher.send(false) } @@ -402,7 +402,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele /// CBCentralManagerDelegate function, must be marked public because of protocol definition public func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) { guard let services = peripheral.services else { - os_log("Unable to locate services for: %@, %@. Error: %@", log: .ledger, type: .debug, peripheral.name ?? "", peripheral.identifier.uuidString, "\(String(describing: error))") + os_log("Unable to locate services for: %@, %@. Error: %@", log: .ledger, type: .default, peripheral.name ?? "", peripheral.identifier.uuidString, "\(String(describing: error))") self.connectedDevice = nil self.deviceConnectedPublisher.send(false) return @@ -419,7 +419,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele /// CBCentralManagerDelegate function, must be marked public because of protocol definition public func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { guard let characteristics = service.characteristics else { - os_log("Unable to locate characteristics for: %@, %@. Error: %@", log: .ledger, type: .debug, peripheral.name ?? "", peripheral.identifier.uuidString, "\(String(describing: error))") + os_log("Unable to locate characteristics for: %@, %@. Error: %@", log: .ledger, type: .default, peripheral.name ?? "", peripheral.identifier.uuidString, "\(String(describing: error))") self.connectedDevice = nil self.deviceConnectedPublisher.send(false) return @@ -427,16 +427,16 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele for characteristic in characteristics { if characteristic.uuid == LedgerNanoXConstant.writeUUID { - os_log("Located write characteristic", log: .ledger, type: .debug) + os_log("Located write characteristic", log: .ledger, type: .default) writeCharacteristic = characteristic } else if characteristic.uuid == LedgerNanoXConstant.notifyUUID { - os_log("Located notify characteristic", log: .ledger, type: .debug) + os_log("Located notify characteristic", log: .ledger, type: .default) notifyCharacteristic = characteristic } if let _ = writeCharacteristic, let notify = notifyCharacteristic { - os_log("Registering for notifications on notify characteristic", log: .ledger, type: .debug) + os_log("Registering for notifications on notify characteristic", log: .ledger, type: .default) peripheral.setNotifyValue(true, for: notify) self.deviceConnectedPublisher.send(true) @@ -448,11 +448,11 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele /// CBCentralManagerDelegate function, must be marked public because of protocol definition public func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) { if let err = error { - os_log("Error during write: %@", log: .ledger, type: .debug, "\( err )") + os_log("Error during write: %@", log: .ledger, type: .default, "\( err )") returnErrorToPublisher(statusCode: GeneralErrorCodes.UNKNOWN.rawValue) } else { - os_log("Successfully wrote to write characteristic", log: .ledger, type: .debug) + os_log("Successfully wrote to write characteristic", log: .ledger, type: .default) } } @@ -462,7 +462,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele return } - os_log("Receiveing value from notify characteristic", log: .ledger, type: .debug) + os_log("Receiveing value from notify characteristic", log: .ledger, type: .default) // Extract the payload, convert it to an APDU so the result can be extracted @@ -486,7 +486,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele if resultString.count <= 6 { - os_log("Received APDU Status code", log: .ledger, type: .debug) + os_log("Received APDU Status code", log: .ledger, type: .default) receivedAPDU_statusCode.send(resultString) if resultString == LedgerService.successCode { @@ -496,7 +496,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele return } else { - os_log("Received APDU Payload", log: .ledger, type: .debug) + os_log("Received APDU Payload", log: .ledger, type: .default) receivedAPDU_payload.send(resultString) return } @@ -550,12 +550,12 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele guard let res = try? concatenatedResult.get() else { let error = (try? concatenatedResult.getError()) ?? KukaiError.unknown() - os_log("setupWriteSubject - received error: %@", log: .ledger, type: .debug, "\(error)") + os_log("setupWriteSubject - received error: %@", log: .ledger, type: .default, "\(error)") self.returnKukaiErrorToPublisher(kukaiError: error) return } - os_log("setupWriteSubject - received value: %@", log: .ledger, type: .debug, "\( res )") + os_log("setupWriteSubject - received value: %@", log: .ledger, type: .default, "\( res )") switch self.requestType { case .address: self.convertAPDUToAddress(payload: res) @@ -588,7 +588,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele if component != "" { let data = (try? Data(hexString: component)) ?? Data() - os_log("sendAPDU - writing payload", log: .ledger, type: .debug) + os_log("sendAPDU - writing payload", log: .ledger, type: .default) self.connectedDevice?.writeValue(data, for: writeCharacteristic, type: .withResponse) } } @@ -597,7 +597,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele // Listen for responses self.receivedAPDU_statusCode.sink { statusCode in if statusCode == LedgerService.successCode { - os_log("sendAPDU - received success statusCode", log: .ledger, type: .debug) + os_log("sendAPDU - received success statusCode", log: .ledger, type: .default) promise(.success(nil)) } else { @@ -610,7 +610,7 @@ public class LedgerService: NSObject, CBPeripheralDelegate, CBCentralManagerDele self.receivedAPDU_payload.sink { payload in - os_log("sendAPDU - received payload: %@", log: .ledger, type: .debug, payload) + os_log("sendAPDU - received payload: %@", log: .ledger, type: .default, payload) promise(.success(payload)) } .store(in: &self.bag_apdu) diff --git a/Sources/KukaiCoreSwift/Services/NetworkService.swift b/Sources/KukaiCoreSwift/Services/NetworkService.swift index 79665b3d..aa8716c0 100644 --- a/Sources/KukaiCoreSwift/Services/NetworkService.swift +++ b/Sources/KukaiCoreSwift/Services/NetworkService.swift @@ -227,9 +227,9 @@ public class NetworkService { let dataString = NetworkService.dataToStringStippingMichelsonContractCode(data: responseData) if isPost { - os_log(.debug, log: .network, "Request Succeeded to: %@ \nRequest Body: %@ \nResponse: %@ \n_", fullURL.absoluteString, payloadString, dataString) + os_log(.default, log: .network, "Request Succeeded to: %@ \nRequest Body: %@ \nResponse: %@ \n_", fullURL.absoluteString, payloadString, dataString) } else { - os_log(.debug, log: .network, "Request Succeeded to: %@ \nResponse: %@ \n_", fullURL.absoluteString, dataString) + os_log(.default, log: .network, "Request Succeeded to: %@ \nResponse: %@ \n_", fullURL.absoluteString, dataString) } } @@ -237,7 +237,7 @@ public class NetworkService { public static func logRequestStart(loggingConfig: LoggingConfig?, fullURL: URL) { if !(loggingConfig?.logNetworkFailures ?? false) && !(loggingConfig?.logNetworkSuccesses ?? false) { return } - os_log(.debug, log: .network, "Sending request to: %@", fullURL.absoluteString) + os_log(.default, log: .network, "Sending request to: %@", fullURL.absoluteString) } /** diff --git a/Sources/KukaiCoreSwift/Services/OperationService.swift b/Sources/KukaiCoreSwift/Services/OperationService.swift index f5ce5a3e..ca5f9fbe 100644 --- a/Sources/KukaiCoreSwift/Services/OperationService.swift +++ b/Sources/KukaiCoreSwift/Services/OperationService.swift @@ -84,7 +84,7 @@ public class OperationService { case .success(let hash): // With a successful Parse, we can continue on to Sign, Preapply (to check for errors) and if no errors, inject the operation - os_log(.debug, log: .kukaiCoreSwift, "Remote parse successful") + os_log(.default, log: .kukaiCoreSwift, "Remote parse successful") self?.signPreapplyAndInject(wallet: wallet, forgedHash: hash, operationPayload: operationPayload, operationMetadata: operationMetadata, completion: completion) case .failure(let parseError): diff --git a/Sources/KukaiCoreSwift/Services/TaquitoService.swift b/Sources/KukaiCoreSwift/Services/TaquitoService.swift index 29181445..009dec23 100644 --- a/Sources/KukaiCoreSwift/Services/TaquitoService.swift +++ b/Sources/KukaiCoreSwift/Services/TaquitoService.swift @@ -97,7 +97,7 @@ public class TaquitoService { // Assign callback handlers for internal JS promise success and error states let forgeSuccessHandler: @convention(block) (String) -> Void = { [weak self] (result) in - os_log("JavascriptContext forge successful", log: .taquitoService, type: .debug) + os_log("JavascriptContext forge successful", log: .taquitoService, type: .default) self?.isForging = false self?.lastForgeCompletionHandler = nil completion(Result.success(result)) @@ -159,7 +159,7 @@ public class TaquitoService { // Assign callback handlers for internal JS promise success and error states let parseSuccessHandler: @convention(block) (String) -> Void = { [weak self] (result) in - os_log("JavascriptContext parse successful", log: .taquitoService, type: .debug) + os_log("JavascriptContext parse successful", log: .taquitoService, type: .default) self?.lastParseCompletionHandler = nil self?.isParsing = false diff --git a/Sources/KukaiCoreSwift/Services/TorusAuthService.swift b/Sources/KukaiCoreSwift/Services/TorusAuthService.swift index 3176e80e..d024b656 100644 --- a/Sources/KukaiCoreSwift/Services/TorusAuthService.swift +++ b/Sources/KukaiCoreSwift/Services/TorusAuthService.swift @@ -200,7 +200,7 @@ public class TorusAuthService: NSObject { Task { @MainActor in do { let data = try await torus.triggerLogin() - os_log("Torus returned succesful data", log: .torus, type: .debug) + os_log("Torus returned succesful data", log: .torus, type: .default) var username: String? = nil var userId: String? = nil diff --git a/Sources/KukaiCoreSwift/Services/WalletCacheService.swift b/Sources/KukaiCoreSwift/Services/WalletCacheService.swift index 6cc140b1..0589e5ca 100644 --- a/Sources/KukaiCoreSwift/Services/WalletCacheService.swift +++ b/Sources/KukaiCoreSwift/Services/WalletCacheService.swift @@ -596,7 +596,7 @@ public class WalletCacheService { */ public func readFromDiskAndDecrypt() -> [String: Wallet]? { guard let data = DiskService.readData(fromFileName: WalletCacheService.sensitiveCacheFileName) else { - os_log(.info, log: .walletCache, "readFromDiskAndDecrypt - no cache file found, returning empty") + os_log(.default, log: .walletCache, "readFromDiskAndDecrypt - no cache file found, returning empty") return [:] // No such file }