apply loglevel color to timestamp

This commit is contained in:
Sebastian Cabrera 2025-06-11 16:34:13 -04:00
parent d7c1fb796d
commit 7412e79881
Signed by: okseby
GPG key ID: DA858232740D0404

View file

@ -26,7 +26,7 @@ const (
func logMessage(level, color, msg string, args ...any) { func logMessage(level, color, msg string, args ...any) {
timestamp := time.Now().Format("2006-01-02 15:04:05") timestamp := time.Now().Format("2006-01-02 15:04:05")
formatted := fmt.Sprintf(msg, args...) formatted := fmt.Sprintf(msg, args...)
output := fmt.Sprintf("[%s] %s[%s]%s %s\n", timestamp, color, level, colorReset, formatted) output := fmt.Sprintf("%s[%s]%s %s[%s]%s %s\n", color, timestamp, colorReset, color, level, colorReset, formatted)
fmt.Print(output) fmt.Print(output)
if level == LevelFatal { if level == LevelFatal {