Skip to content

Commit

Permalink
log: change level type to string
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 authored and mmatczuk committed Jun 11, 2024
1 parent f767dc6 commit 3cc9824
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions log/level.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

package log

type Level int32
type Level string

const (
ErrorLevel Level = iota
InfoLevel
DebugLevel
ErrorLevel Level = "error"
InfoLevel Level = "info"
DebugLevel Level = "debug"
)

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

0 comments on commit 3cc9824

Please sign in to comment.