micro/logger/logger_test.go
Vasiliy Tolstov 7b3a7a9448 logger: update logger interface
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-10 18:56:39 +03:00

19 lines
367 B
Go

package logger
import (
"context"
"testing"
)
func TestLogger(t *testing.T) {
ctx := context.TODO()
l := NewLogger(WithLevel(TraceLevel))
if err := l.Init(); err != nil {
t.Fatal(err)
}
l.Trace(ctx, "trace_msg1")
l.Warn(ctx, "warn_msg1")
l.Fields(map[string]interface{}{"error": "test"}).Info(ctx, "error message")
l.Warn(ctx, "first", " ", "second")
}