feat: export default logger

master
Evan Chen 2021-11-03 23:05:38 +08:00
parent c540497ce6
commit d1cdb89bd4
2 changed files with 12 additions and 0 deletions

View File

@ -144,3 +144,11 @@ func TestApplyChild(t *testing.T) {
l2.Info("child2-nocolor")
l3.Info("child3-nocolor")
}
func TestDefaultLogger(t *testing.T) {
l := DefaultLogger()
l.Error("TestDefaultLogger")
l.Debug("TestDefaultLogger")
l.Warn("TestDefaultLogger")
l.Info("TestDefaultLogger")
}

4
std.go
View File

@ -9,6 +9,10 @@ import (
var std = New("")
func DefaultLogger() *Logger {
return std
}
func M(s interface{}, attrs ...color.Attribute) string {
return std.M(s, attrs...)
}