* fix #1883

* fix #1883

Co-authored-by: 杨羽 <yangyu@doumi.com>
This commit is contained in:
yu 2020-07-29 19:45:25 +08:00 committed by GitHub
parent 9813f98c8b
commit d66803a136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -209,6 +209,7 @@ func GetLogger() dlog.Log {
// SetLevel sets the log level
func SetLevel(l Level) {
atomic.StoreInt32((*int32)(&level), int32(l))
nlog.Init(nlog.WithLevel(levelToLevel(l)))
}
// GetLevel returns the current level

13
util/log/log_test.go Normal file
View File

@ -0,0 +1,13 @@
package log
import (
"testing"
)
func TestDebug(t *testing.T) {
SetLevel(LevelDebug)
Debug(123)
}
func TestMain(m *testing.M) {
m.Run()
}