mirror of
https://github.com/talent-plan/tinykv.git
synced 2024-12-25 20:30:30 +08:00
log: make log level case insensitive (#407)
Signed-off-by: SpadeA-Tang <u6748471@anu.edu.au>
This commit is contained in:
parent
28f12587cb
commit
be014c2aee
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user