From edecd4a8d72bc7ab0cd7b3ad3db4a0b8ddd1cc9b Mon Sep 17 00:00:00 2001 From: bryanqiu Date: Fri, 21 Jul 2023 11:40:48 +0800 Subject: [PATCH] add SetLogLevelByName --- log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log.go b/log.go index 7ca7b8a..969a22d 100644 --- a/log.go +++ b/log.go @@ -94,9 +94,9 @@ func (log *Logger) SetLogLevel(newlv LogLevel) (oldlv LogLevel) { // SetLogLevelByName set new log level by level name func (log *Logger) SetLogLevelByName(newlv string) (oldlv string) { if newlevel, ok := mapStrToLevel[newlv]; ok { - oldlv = log.loglevel + oldlevel := log.loglevel log.loglevel = newlevel - return mapLevelToStr[oldlv] + return mapLevelToStr[oldlevel] } return ErrLogLevel }