apply loglevel color to timestamp
This commit is contained in:
parent
d7c1fb796d
commit
7412e79881
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ const (
|
|||
func logMessage(level, color, msg string, args ...any) {
|
||||
timestamp := time.Now().Format("2006-01-02 15:04:05")
|
||||
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)
|
||||
|
||||
if level == LevelFatal {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue