diff --git a/TangemSdk/TangemSdk/Common/Core/Config.swift b/TangemSdk/TangemSdk/Common/Core/Config.swift index 62c1445c4..9b2d67a95 100644 --- a/TangemSdk/TangemSdk/Common/Core/Config.swift +++ b/TangemSdk/TangemSdk/Common/Core/Config.swift @@ -42,7 +42,7 @@ public struct Config { public var cardIdDisplayFormat: CardIdDisplayFormat = .full /// Logger configuration - public var logConfig: Log.Config = .debug + public var logConfig: Log.Config = .default /// ScanTask or scanCard method in TangemSdk class will use this mode to attest the card public var attestationMode: AttestationTask.Mode = .normal diff --git a/TangemSdk/TangemSdk/Common/Log/Log.swift b/TangemSdk/TangemSdk/Common/Log/Log.swift index 67a00fd5a..a7a816262 100644 --- a/TangemSdk/TangemSdk/Common/Log/Log.swift +++ b/TangemSdk/TangemSdk/Common/Log/Log.swift @@ -11,16 +11,18 @@ import Foundation private let logger = Log() public class Log { - public static var config: Log.Config = .verbose { + public static var config: Config = .default { didSet { logger.logLevel = config.logLevel logger.loggers = config.loggers } } - private(set) var logLevel: [Log.Level] = [] + private(set) var logLevel: [Log.Level] = Log.config.logLevel - private(set) var loggers: [TangemSdkLogger] = [] + private(set) var loggers: [TangemSdkLogger] = Log.config.loggers + + fileprivate init() {} public static func warning(_ message: @autoclosure () -> T) { logger.logInternal(message(), level: .warning) @@ -136,6 +138,8 @@ public extension Log { case verbose case custom(logLevel: [Log.Level], loggers: [TangemSdkLogger] = [ConsoleLogger()]) + + static var `default`: Log.Config = .debug internal var logLevel: [Log.Level] { switch self {