You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where the std logger will be highly verbose. Since levels don't apply, all the logs will be written. Sampling is no good either since the messages will be different.
The sampler is the closest related feature, but as you mentioned, it doesn't help with the messages are variable, as it's used to throttle specific message/level combinations.
The sampler could be extended to accept a custom hash function, but what you're using seems like a good simple option.
Consider the following use case
zap.RedirectStdLog(aZapLogger)
where the std logger will be highly verbose. Since levels don't apply, all the logs will be written. Sampling is no good either since the messages will be different.
Ideally I would like to write something like this
zap.RedirectStdLog(aZapLogger.WithOption(someRateLimitingOption))
Basically saying: "I don't want more than N logs per M seconds"
Does
zap
provide some sort of primitive to accomplish this, that I missed while reading the docs ?The text was updated successfully, but these errors were encountered: