parent
9813f98c8b
commit
d66803a136
@ -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()
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user