* fix #1883 * fix #1883 Co-authored-by: 杨羽 <yangyu@doumi.com>
This commit is contained in:
@@ -209,6 +209,7 @@ func GetLogger() dlog.Log {
|
|||||||
// SetLevel sets the log level
|
// SetLevel sets the log level
|
||||||
func SetLevel(l Level) {
|
func SetLevel(l Level) {
|
||||||
atomic.StoreInt32((*int32)(&level), int32(l))
|
atomic.StoreInt32((*int32)(&level), int32(l))
|
||||||
|
nlog.Init(nlog.WithLevel(levelToLevel(l)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLevel returns the current level
|
// GetLevel returns the current level
|
||||||
|
13
util/log/log_test.go
Normal file
13
util/log/log_test.go
Normal 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()
|
||||||
|
}
|
Reference in New Issue
Block a user