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

Stop overwriting logger on struct when adding fields #14

Merged
merged 2 commits into from
May 1, 2022
Merged

Conversation

bombsimon
Copy link
Owner

When adding caller, and for Info logs any other field, don't overwrite the
logger on the logrusr struct directly since we only want each individual
message to contain this information.

To make this easier, also always treat the logger internally as a
logrus.Entry so we don't need to type cast when using it. This also
makes us able to use the public duplication interface when duplicating
the logger.

Add race detection flag when running tests

bombsimon added 2 commits May 1, 2022 23:06
When adding caller, and for Info logs any other field, don't overwrite the
logger on the logrusr struct directly since we only want each individual
message to contain this information.

To make this easier, also always treat the logger internally as a
`logrus.Entry` so we don't need to type cast when using it. This also
makes us able to use the public duplication interface when duplicating
the logger.
@bombsimon bombsimon merged commit 2c41a25 into main May 1, 2022
@bombsimon bombsimon deleted the copy-logger branch May 1, 2022 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant