Skip to content

Commit

Permalink
Make the log timestamps darker
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Nov 28, 2024
1 parent 4c8061c commit 87915aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/logger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func logMessage(level byte, format string, a ...any) string {
}

timestamp := time.Now().Format(time.DateTime)
timestamp = fmt.Sprintf("[%s]", timestamp)
var str string

switch level {
Expand All @@ -42,7 +43,7 @@ func logMessage(level byte, format string, a ...any) string {
str = format
}

str = fmt.Sprintf("[%s] %s\n", timestamp, str)
str = fmt.Sprintf("%s %s\n", color.HiBlackString(timestamp), str)
output := fmt.Sprintf(str, a...)

fmt.Print(output)
Expand Down

0 comments on commit 87915aa

Please sign in to comment.