mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
add log
This commit is contained in:
@@ -34,12 +34,16 @@ func SetLogLevel(l string) {
|
|||||||
switch strings.TrimSpace(strings.ToLower(l)) {
|
switch strings.TrimSpace(strings.ToLower(l)) {
|
||||||
case "debug":
|
case "debug":
|
||||||
atom.SetLevel(zap.DebugLevel)
|
atom.SetLevel(zap.DebugLevel)
|
||||||
|
Debug("set log level to debug")
|
||||||
case "info":
|
case "info":
|
||||||
atom.SetLevel(zap.InfoLevel)
|
atom.SetLevel(zap.InfoLevel)
|
||||||
|
Info("set log level to info")
|
||||||
case "warn", "warnning":
|
case "warn", "warnning":
|
||||||
atom.SetLevel(zap.WarnLevel)
|
atom.SetLevel(zap.WarnLevel)
|
||||||
|
Warn("set log level to warnning")
|
||||||
case "error":
|
case "error":
|
||||||
atom.SetLevel(zap.ErrorLevel)
|
atom.SetLevel(zap.ErrorLevel)
|
||||||
|
Error("set log level to error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user