We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Please describe. I would want to override encoder, to mask some data out from logs, or encode it:
type MaskingEncoder struct { zapcore.Encoder } func (m *MaskingEncoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error) { filtered := make([]zapcore.Field, 0, len(fields)) for _, field := range fields { key := strings.ToLower(field.Key) if slices.ContainsFunc(skipFieldRegexps, func(r *regexp.Regexp) bool { return r.Match([]byte(key)) }) { continue } filtered = append(filtered, field) } return m.Encoder.EncodeEntry(entry, filtered) }
And I want to wrap sinker to dump all the requests to a buffer to test logging.
Describe the solution you'd like I would like to do it same way it is done for zapcore.Core, via zap.WrapCore:
zapcore.Core
zap.WrapCore
l, err := zapConf.Build(zapcore.WrapEncoder())
Describe alternatives you've considered Alternatives to wrap encoder:
zapcore.Config.Build
Alternatives to wrap sinker:
Is this a breaking change? Nope
The text was updated successfully, but these errors were encountered:
Add option to override sink and encoder (uber-go#1438)
67fceae
Makes it possible to override/wrap encoder/sink
3c04ee1
9591248
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
I would want to override encoder, to mask some data out from logs, or encode it:
And I want to wrap sinker to dump all the requests to a buffer to test logging.
Describe the solution you'd like
I would like to do it same way it is done for
zapcore.Core
, viazap.WrapCore
:Describe alternatives you've considered
Alternatives to wrap encoder:
zapcore.Config.Build
code and inject it in thereAlternatives to wrap sinker:
zapcore.Config.Build
code and inject it in thereIs this a breaking change?
Nope
The text was updated successfully, but these errors were encountered: