logger: add With() shortcut alias

This commit is contained in:
wpetit 2020-03-17 14:10:25 +01:00
parent 67e87adf89
commit 42aba649c8
1 changed files with 4 additions and 0 deletions

View File

@ -103,3 +103,7 @@ func SetLevel(level Level) {
func SetFormat(format Format) {
defaultLogger = Make(format, os.Stdout)
}
func With(ctx context.Context, fields ...Field) context.Context {
return slog.With(ctx, fields...)
}