diff --git a/util/log/log.go b/util/log/log.go index 75167947..e86a757b 100644 --- a/util/log/log.go +++ b/util/log/log.go @@ -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 diff --git a/util/log/log_test.go b/util/log/log_test.go new file mode 100644 index 00000000..872b02c4 --- /dev/null +++ b/util/log/log_test.go @@ -0,0 +1,13 @@ +package log + +import ( + "testing" +) + +func TestDebug(t *testing.T) { + SetLevel(LevelDebug) + Debug(123) +} +func TestMain(m *testing.M) { + m.Run() +}