Skip to content
New issue

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

Increasing level is reset after With #810

Closed
mlitvin opened this issue Apr 2, 2020 · 1 comment · Fixed by #812
Closed

Increasing level is reset after With #810

mlitvin opened this issue Apr 2, 2020 · 1 comment · Fixed by #812
Assignees

Comments

@mlitvin
Copy link

mlitvin commented Apr 2, 2020

IncreaseLevel work by using core of type levelFilterCore. This core doesn't explicitly implement With, so it is "inherited" by the underlying core.

The result is that when calling With, it revert to the original log level

@prashantv
Copy link
Collaborator

Looks like we are relying on the default With of the underlying core as we didn't implement a specific With on the increase-level core. Thanks for flagging this, I'll get a fix out.

@prashantv prashantv self-assigned this Apr 3, 2020
prashantv added a commit that referenced this issue Apr 3, 2020
Fixes #810

We missed implementing the increase-level logic in With
and since Core was embedded, we wended up using With from
the original core.

To avoid this sort of issue, avoid embedding and implement all
Core methods explicitly. This lets us consider the behaviour
of each method explicitly.
prashantv added a commit that referenced this issue Apr 11, 2020
Fixes #810

We missed implementing the increase-level logic in With
and since Core was embedded, we wended up using With from
the original core.

To avoid this sort of issue, avoid embedding and implement all
Core methods explicitly. This lets us consider the behaviour
of each method explicitly.
uvfive pushed a commit to bxsmart/zap that referenced this issue May 21, 2020
Fixes uber-go#810

We missed implementing the increase-level logic in With
and since Core was embedded, we wended up using With from
the original core.

To avoid this sort of issue, avoid embedding and implement all
Core methods explicitly. This lets us consider the behaviour
of each method explicitly.
cgxxv pushed a commit to cgxxv/zap that referenced this issue Mar 25, 2022
Fixes uber-go#810

We missed implementing the increase-level logic in With
and since Core was embedded, we wended up using With from
the original core.

To avoid this sort of issue, avoid embedding and implement all
Core methods explicitly. This lets us consider the behaviour
of each method explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants