mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-20 03:29:45 +02:00
d78eb3ee4b
* add level printer * fix helper args * fix test * Update README.md
21 lines
429 B
Go
21 lines
429 B
Go
package log
|
|
|
|
import (
|
|
"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")
|
|
}
|