From 3543e9d94bc5ed088dd2d9ad1d19c7ccd0fa65f5 Mon Sep 17 00:00:00 2001 From: Pavel Gryaznov Date: Fri, 11 Nov 2022 14:15:40 +0100 Subject: [PATCH] parsing CAPS log levels (#506) --- log.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/log.go b/log.go index efd2a330..c8dbc425 100644 --- a/log.go +++ b/log.go @@ -105,6 +105,7 @@ import ( "io/ioutil" "os" "strconv" + "strings" ) // Level defines log levels. @@ -160,7 +161,7 @@ func (l Level) String() string { // ParseLevel converts a level string into a zerolog Level value. // returns an error if the input string does not match known values. func ParseLevel(levelStr string) (Level, error) { - switch levelStr { + switch strings.ToLower(levelStr) { case LevelFieldMarshalFunc(TraceLevel): return TraceLevel, nil case LevelFieldMarshalFunc(DebugLevel):