diff --git a/log_test.go b/log_test.go index e7ae661..7f8a594 100644 --- a/log_test.go +++ b/log_test.go @@ -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") +} diff --git a/std.go b/std.go index aee43b5..2260205 100644 --- a/std.go +++ b/std.go @@ -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...) }