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

zerolog.Context now knows how to LoggerRef() #354

Closed
wants to merge 1 commit into from

Conversation

rsrchboy
Copy link

@rsrchboy rsrchboy commented Sep 4, 2021

This should be simple enough -- same as Logger(), but with a different return, useful for chaining with WithContext().

I've included a simple test case, just to demonstrate this addresses the issue in #116

Fixes #116

This should be simple enough -- same as `Logger()`, but with a different
return, useful for chaining with WithContext().

I've included a simple test case, just to demonstrate this addresses the
issue in rs#116

Fixes rs#116
@rs
Copy link
Owner

rs commented Sep 4, 2021

This is confusing and is bloating the lib API.

@rsrchboy
Copy link
Author

rsrchboy commented Sep 5, 2021

So, in #116 you invited a fix / PR to address the issue; this is the approach that was discussed.

Do you have an alternate approach to suggest, or should #116 be closed as wontfix?

@rs
Copy link
Owner

rs commented Sep 5, 2021

The discussed solution was to make WithContext a non pointer method. See #116 (comment)

@rsrchboy
Copy link
Author

Ah. I was going off of the prior comment #116 (comment), and looking for a minimal "won't break anything" solution.

@rsrchboy rsrchboy closed this Sep 22, 2021
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.

Chaining WithContext call is broken
2 participants