From 914aad7353f090b351473375d0b2fca5e87c0fe5 Mon Sep 17 00:00:00 2001 From: mishamyrt Date: Sat, 13 Jul 2024 15:13:25 +0300 Subject: [PATCH] feat: dim log timestamp --- Sources/Logger/Logger.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/Logger/Logger.swift b/Sources/Logger/Logger.swift index d782b46..3caf74a 100644 --- a/Sources/Logger/Logger.swift +++ b/Sources/Logger/Logger.swift @@ -7,7 +7,11 @@ struct Logger { var out: UnsafeMutablePointer var showTimestamp: Bool - init(level: LogLevel = .error, out: UnsafeMutablePointer = stdout, showTimestamp: Bool = true) { + init( + level: LogLevel = .error, + out: UnsafeMutablePointer = stdout, + showTimestamp: Bool = true + ) { self.level = level self.out = out self.showTimestamp = showTimestamp @@ -22,7 +26,7 @@ struct Logger { func print(_ message: String) { var line = "" if showTimestamp { - line += timestamp() + " " + line += timestamp().dim + " " } line += message fputs(line + "\n", out)