kis-flow/test/kis_log_test.go
2024-04-08 19:03:20 +08:00

31 lines
761 B
Go

package test
import (
"context"
"github.com/aceld/kis-flow/log"
"testing"
)
func TestKisLogger(t *testing.T) {
ctx := context.Background()
log.Logger().DebugF("TestKisLogger Format DebugF name = %s, age = %d", "kisFlow", 23)
log.Logger().ErrorF("TestKisLogger Format ErrorF name = %s, age = %d", "kisFlow", 12)
log.Logger().InfoF("TestKisLogger Format InfoF name = %s, stu =%+v", "kisFlow",
struct {
name string
age int
}{
name: "kisName",
age: 12,
})
log.Logger().InfoX(ctx, "TestKisLogger InfoX")
log.Logger().ErrorX(ctx, "TestKisLogger ErrorX")
log.Logger().DebugX(ctx, "TestKisLogger DebugX")
log.Logger().Info("TestKisLogger Info")
log.Logger().Error("TestKisLogger Error")
log.Logger().Debug("TestKisLogger Debug")
}