Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tureck1y committed Dec 30, 2024
1 parent 197cb08 commit e7faf52
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion TangemSdk/TangemSdk/Common/Log/Log.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public extension Log {
case .release:
return [.error]
case .verbose:
return Log.Level.allCases
return [.warning, .error, .command, .debug, .nfc, .session]
}
}

Expand Down
2 changes: 2 additions & 0 deletions TangemSdk/TangemSdk/Common/Log/Logger/ConsoleLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ public class ConsoleLogger: TangemSdkLogger {
}()

public func log(_ message: String, level: Log.Level) {
#if DEBUG
guard Log.filter(level) else { return }

loggerSerialQueue.async {
print("\(level.emoji) \(self.dateFormatter.string(from: Date())):\(level.prefix) \(message)")
}
#endif //DEBUG
}
}
1 change: 0 additions & 1 deletion TangemSdk/TangemSdk/Common/NFC/NFCReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ extension NFCReader: CardReader {
guard let self = self else { return }

Log.nfc("Success response from card received")
Log.apdu(rApdu)
self.sendRetryCount = Constants.retryCount
self.startIdleTimer()
})
Expand Down
4 changes: 2 additions & 2 deletions TangemSdk/TangemSdk/Common/TLV/TlvTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ public enum TlvTag: Byte {
.newPin2,
.newPin3,
.walletPublicKey,
.walletPrivateKey:
.walletPrivateKey,
.walletHDChain:
return true
case .unknown,
.cardId,
Expand Down Expand Up @@ -295,7 +296,6 @@ public enum TlvTag: Byte {
.fileCounter,
.fileOwnerIndex,
.walletHDPath,
.walletHDChain,
.certificate,
.backupStatus,
.backupCount,
Expand Down

0 comments on commit e7faf52

Please sign in to comment.