mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-07 23:02:12 +02:00
21557b38f6
* add log context & valuer
23 lines
415 B
Go
23 lines
415 B
Go
package log
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestLogger(t *testing.T) {
|
|
logger := DefaultLogger
|
|
Debug(logger).Print("log", "test debug")
|
|
Info(logger).Print("log", "test info")
|
|
Warn(logger).Print("log", "test warn")
|
|
Error(logger).Print("log", "test error")
|
|
}
|
|
|
|
func TestWrapper(t *testing.T) {
|
|
out := NewStdLogger(os.Stdout)
|
|
err := NewStdLogger(os.Stderr)
|
|
|
|
l := Wrap(out, err)
|
|
l.Print("message", "test")
|
|
}
|