1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-22 03:38:41 +02:00
kratos/log/log_test.go

21 lines
429 B
Go
Raw Normal View History

2021-02-17 17:14:47 +08:00
package log
import (
"os"
2021-02-17 17:14:47 +08:00
"testing"
)
func TestInfo(t *testing.T) {
logger := DefaultLogger
logger = With(logger, "ts", DefaultTimestamp, "caller", DefaultCaller)
logger.Log(LevelInfo, "key1", "value1")
2021-02-17 17:14:47 +08:00
}
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")
}