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

Allow logger creation from an existing standard logger #345

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

dbhoot
Copy link
Contributor

@dbhoot dbhoot commented Apr 10, 2024

Previously

You could not create a req.Logger from a log.Logger. Instead, you have to create one from an io.Writer.

Unfortunately, there are situations when you do not have access to the underlying io.Writer for your .Logger. This limits your ability to set the client logger using the tooling of your choice.

Now

You can usually convert your .Logger into a log.Logger. With this PR, you're now able to create a req.Logger from a log.Logger and set your client logger as needed.

@dbhoot
Copy link
Contributor Author

dbhoot commented Apr 12, 2024

@imroc what are your thoughts on this change? Please review when you have a moment.

@imroc
Copy link
Owner

imroc commented Apr 12, 2024

I think it's better to rename to NewLoggerFromStandardLogger, a bit longer, but no ambiguity.

@dbhoot
Copy link
Contributor Author

dbhoot commented Apr 12, 2024

I think it's better to rename to NewLoggerFromStandardLogger, a bit longer, but no ambiguity.

I agree. I was thinking of making that change anyway. Good call.

@imroc
Copy link
Owner

imroc commented Apr 13, 2024

NewFromStandardLogger --> NewLoggerFromStandardLogger

@imroc imroc merged commit 22b0784 into imroc:master Apr 15, 2024
2 checks passed
@imroc
Copy link
Owner

imroc commented Apr 15, 2024

Thanks

@dbhoot dbhoot deleted the feat/allow-standard-logger branch April 15, 2024 17:44
@dbhoot
Copy link
Contributor Author

dbhoot commented Apr 15, 2024

@imroc do we need a new release for this?

@imroc
Copy link
Owner

imroc commented Apr 16, 2024

Released at v3.43.3

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