Skip to content

Commit

Permalink
log: start levels from 1
Browse files Browse the repository at this point in the history
That would eliminate the zero value issue with flags.

Fixes #832
  • Loading branch information
Choraden committed Jun 18, 2024
1 parent b6a0d6a commit f7b0956
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions log/level.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ package log
type Level int32

const (
ErrorLevel Level = iota
ErrorLevel Level = 1 + iota
InfoLevel
DebugLevel
)

func (l Level) String() string {
return [3]string{"error", "info", "debug"}[l]
return [3]string{"error", "info", "debug"}[l-1]
}

0 comments on commit f7b0956

Please sign in to comment.