From be014c2aeef515557e18ae183c8214364c687b79 Mon Sep 17 00:00:00 2001 From: Spade A <71589810+SpadeA-Tang@users.noreply.github.com> Date: Wed, 6 Jul 2022 17:41:23 +0800 Subject: [PATCH] log: make log level case insensitive (#407) Signed-off-by: SpadeA-Tang --- log/log.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/log/log.go b/log/log.go index a587c7d0..a9b23b07 100644 --- a/log/log.go +++ b/log/log.go @@ -13,6 +13,7 @@ import ( "log" "os" "runtime" + "strings" ) const ( @@ -232,6 +233,7 @@ func (l *Logger) Infof(format string, v ...interface{}) { } func StringToLogLevel(level string) LogLevel { + level = strings.ToLower(level) switch level { case "fatal": return LOG_LEVEL_FATAL