diff --git a/log/level.go b/log/level.go index eb60b96b..03f0219b 100644 --- a/log/level.go +++ b/log/level.go @@ -6,14 +6,14 @@ package log -type Level string +type Level int32 const ( - ErrorLevel Level = "error" - InfoLevel Level = "info" - DebugLevel Level = "debug" + ErrorLevel Level = 1 + iota + InfoLevel + DebugLevel ) func (l Level) String() string { - return string(l) + return [3]string{"error", "info", "debug"}[l-1] }