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
Any fields added via the config, or via With to the logger before calling zap.WrapCore are not seen at all by the observer via the context.
Describe the solution you'd like
After building a logger with fields using .Build(), allow using zap.WrapCore to be able to split, or replace the core of a logger, but keep the fields that were added via the configuration, i.e.
This could be done either via exposing Context on core, or internally by copying the context from one core to the other, although allowing the developer to choose the scenario that fits him best would be better.
Describe alternatives you've considered
None so far that wouldn't involve heavy refactoring.
Is this a breaking change?
It should not be a breaking change.
Additional context
N/A/
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
https://go.dev/play/p/vlsJxJfxhUL
Any fields added via the config, or via
With
to the logger before callingzap.WrapCore
are not seen at all by the observer via the context.Describe the solution you'd like
After building a logger with fields using
.Build()
, allow usingzap.WrapCore
to be able to split, or replace the core of a logger, but keep the fields that were added via the configuration, i.e.This could be done either via exposing
Context
oncore
, or internally by copying the context from one core to the other, although allowing the developer to choose the scenario that fits him best would be better.Describe alternatives you've considered
None so far that wouldn't involve heavy refactoring.
Is this a breaking change?
It should not be a breaking change.
Additional context
N/A/
The text was updated successfully, but these errors were encountered: