2020-02-29 03:31:59 +03:00
|
|
|
package logger
|
|
|
|
|
2020-03-26 01:00:43 +03:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
2020-02-29 03:31:59 +03:00
|
|
|
|
|
|
|
func TestLogger(t *testing.T) {
|
|
|
|
l := NewLogger(WithLevel(TraceLevel))
|
2020-11-04 00:38:12 +03:00
|
|
|
if err := l.Init(); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
l.Trace("trace_msg1")
|
|
|
|
l.Warn("warn_msg1")
|
|
|
|
l.Fields(map[string]interface{}{"error": "test"}).Info("error message")
|
2020-02-29 03:31:59 +03:00
|
|
|
}
|