Skip to content

Commit

Permalink
fix space in log levels (#1167)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyonur authored May 8, 2024
1 parent 0f3c27d commit 1523fd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions log/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func (h *TerminalHandler) format(buf []byte, r slog.Record, usecolor bool) []byt
b.WriteString(LevelAlignedString(r.Level))
}

b.WriteByte(' ')

// Prefix is added compared to upstream
if h.Prefix != nil {
b.WriteString(h.Prefix(r))
Expand Down
6 changes: 3 additions & 3 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ func LevelAlignedString(l slog.Level) string {
case slog.LevelDebug:
return "DEBUG"
case slog.LevelInfo:
return "INFO "
return "INFO"
case slog.LevelWarn:
return "WARN "
return "WARN"
case slog.LevelError:
return "ERROR"
case LevelCrit:
return "CRIT "
return "CRIT"
default:
return "unknown level"
}
Expand Down

0 comments on commit 1523fd0

Please sign in to comment.