update source (#14)
Some checks failed
continuous-integration/drone/push Build is failing

Reviewed-on: #14
Co-authored-by: andrey <andrey@4devs.io>
Co-committed-by: andrey <andrey@4devs.io>
This commit was merged in pull request #14.
This commit is contained in:
2024-01-03 18:44:40 +03:00
parent 24a5d3dd88
commit acaa46b73f
12 changed files with 170 additions and 47 deletions

View File

@@ -85,6 +85,12 @@ func WithContextValue(keys ...fmt.Stringer) Middleware {
}
}
func WithName(name string) Middleware {
return func(ctx context.Context, data *entry.Entry, handler Logger) (int, error) {
return handler(ctx, data.Replace(KeyName, field.StringValue(name)))
}
}
// WithCaller adds called file.
// Deprecated: use WithSource.
func WithCaller(key string, depth int, full bool) Middleware {