Skip to content

Commit

Permalink
parsing CAPS log levels (rs#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
GRbit authored and pablitoc committed Apr 7, 2023
1 parent 084c0db commit 7c0b325
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ import (
"io/ioutil"
"os"
"strconv"
"strings"
)

// Level defines log levels.
Expand Down Expand Up @@ -161,7 +162,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):
Expand Down

0 comments on commit 7c0b325

Please sign in to comment.