Skip to content

Commit

Permalink
feat: dim log timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Jul 13, 2024
1 parent 0b8275e commit 914aad7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/Logger/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ struct Logger {
var out: UnsafeMutablePointer<FILE>
var showTimestamp: Bool

init(level: LogLevel = .error, out: UnsafeMutablePointer<FILE> = stdout, showTimestamp: Bool = true) {
init(
level: LogLevel = .error,
out: UnsafeMutablePointer<FILE> = stdout,
showTimestamp: Bool = true
) {
self.level = level
self.out = out
self.showTimestamp = showTimestamp
Expand All @@ -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)
Expand Down

0 comments on commit 914aad7

Please sign in to comment.