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

Preserve context in With() calls #17

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

tcnghia
Copy link
Contributor

@tcnghia tcnghia commented Jun 19, 2024

Currently With() will reset context back to context.Background(), causing the wrap/wrapf calls to lose the original context.

This affects the clog/gcp handler who relies on a value keyed with "trace" being set on the context (see) (we should use a typed value though, but that's in a different PR).

@tcnghia tcnghia changed the title Logger#With(l) to preserve l.context() Preserve context in With() calls Jun 19, 2024
@tcnghia tcnghia requested review from wlynch and imjasonh June 19, 2024 00:26
Signed-off-by: Nghia Tran <[email protected]>
Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@imjasonh imjasonh merged commit f300b26 into chainguard-dev:main Jun 19, 2024
2 checks passed
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.

2 participants