1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-30 04:31:03 +02:00
kratos/log/log_test.go
海雨 7cd9503b95
test: add log test (#1576)
* test: add log test

* fix

* fix lint
2021-10-21 17:39:33 +08:00

26 lines
528 B
Go

package log
import (
"context"
"os"
"testing"
)
func TestInfo(t *testing.T) {
logger := DefaultLogger
logger = With(logger, "ts", DefaultTimestamp, "caller", DefaultCaller)
_ = logger.Log(LevelInfo, "key1", "value1")
}
func TestWrapper(t *testing.T) {
out := NewStdLogger(os.Stdout)
err := NewStdLogger(os.Stderr)
l := With(MultiLogger(out, err), "ts", DefaultTimestamp, "caller", DefaultCaller)
_ = l.Log(LevelInfo, "msg", "test")
}
func TestWithContext(t *testing.T) {
WithContext(context.Background(), nil)
}