mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-07 23:02:12 +02:00
.. | ||
filter_test.go | ||
filter.go | ||
helper_test.go | ||
helper.go | ||
level.go | ||
log_test.go | ||
log.go | ||
README.md | ||
std_test.go | ||
std.go | ||
value_test.go | ||
value.go |
Log
Usage
Structured logging
Logger logger = log.MultiLogger(log.NewStdLogger(os.Stdout), syslog.NewLogger())
logger = log.With(logger,
"service.name", "hellworld",
"service.version", "v1.0.0",
"ts", log.DefaultTimestamp,
"caller", log.DefaultCaller,
)
logger.Log(log.LevelInfo, "key", "value")
Helper helper = log.NewHelper(logger)
helper.Log(log.LevelInfo, "key", "value")
helper.Info("info message")
helper.Infof("info %s", "message")
helper.Infow("key", "value")