diff --git a/Sources/AppLogger/AppLogger.swift b/Sources/AppLogger/AppLogger.swift index c1df71e..4891271 100644 --- a/Sources/AppLogger/AppLogger.swift +++ b/Sources/AppLogger/AppLogger.swift @@ -32,29 +32,9 @@ public struct AppLogger: AppLogging { "\(file.components(separatedBy: "/").last ?? "---") - \(function) - line \(line)" } - // MARK: - Default Print + // MARK: - Print Tags public static func print( - tag: DefaultLogType = .debug, - _ items: Any..., - separator: String = " ", - file: String = #file, - function: String = #function, - line: Int = #line) - { - #if DEBUG - guard isLoggerEnabled else { return } - - let output = items.map { "\($0)" }.joined(separator: separator) - - logStrategy.log(message: "\(tag.label)\n\(output)", - tag: tag, - category: formatLocationInfo(file: file, function: function, line: line)) - #endif - } - - // MARK: - Print Custom Tags - public static func printCustom( - tag: (any LogType)? = nil, + tag: (any LogType) = DefaultLogType.debug, _ items: Any..., separator: String = " ", file: String = #file, @@ -66,8 +46,8 @@ public struct AppLogger: AppLogging { let output = items.map { "\($0)" }.joined(separator: separator) - logStrategy.log(message: "\(tag?.label ?? "")\n\(output)", - tag: tag ?? logStrategy.defaultLogType, + logStrategy.log(message: "\(tag.label)\n\(output)", + tag: tag, category: formatLocationInfo(file: file, function: function, line: line)) #endif } diff --git a/Sources/AppLogger/AppLogging.swift b/Sources/AppLogger/AppLogging.swift index 3bbea97..a2b3f22 100644 --- a/Sources/AppLogger/AppLogging.swift +++ b/Sources/AppLogger/AppLogging.swift @@ -17,19 +17,12 @@ public protocol AppLogging { /// - function: source function of log /// - line: file's line number of log static func print( - tag: DefaultLogType, + tag: (any LogType), _ items: Any..., separator: String, file: String, function: String, line: Int) - - static func printCustom(tag: (any LogType)?, - _ items: Any..., - separator: String, - file: String, - function: String, - line: Int) } // MARK: - Logging Tag