mirror of
https://gitee.com/shikong-sk/gofiber-study
synced 2025-02-23 07:12:16 +08:00
logger 支持动态设置日志级别
This commit is contained in:
parent
8365c1b98f
commit
15a71eadef
@ -7,11 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestLogger(t *testing.T) {
|
func TestLogger(t *testing.T) {
|
||||||
Logger().Debugf("%s", time.Now().Format("2006-01-02 15:04:05.999"))
|
Logger().Debugf("%s", time.Now().Format("2006-01-02 15:04:05.000"))
|
||||||
Logger().Infof("%s", time.Now().Format("2006-01-02 15:04:05.999"))
|
Logger().Infof("%s", time.Now().Format("2006-01-02 15:04:05.000"))
|
||||||
|
|
||||||
SetLevel(zapcore.InfoLevel)
|
SetLevel(zapcore.InfoLevel)
|
||||||
|
|
||||||
Logger().Debugf("%s", time.Now().Format("2006-01-02 15:04:05.999"))
|
Logger().Debugf("%s", time.Now().Format("2006-01-02 15:04:05.000"))
|
||||||
Logger().Infof("%s", time.Now().Format("2006-01-02 15:04:05.999"))
|
Logger().Infof("%s", time.Now().Format("2006-01-02 15:04:05.000"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user