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

Change parameter type of http.Logger() to interface #144

Closed
fho opened this issue Aug 12, 2019 · 4 comments
Closed

Change parameter type of http.Logger() to interface #144

fho opened this issue Aug 12, 2019 · 4 comments

Comments

@fho
Copy link

fho commented Aug 12, 2019

The http.Logger() interface expects a log.Logger type as parameter.

Instead of expecting log.Logger, define a simple logger interface with the Printf() method and change the parameter to that interface.

That will allow to use other loggers then log.Logger of the stdlib as reporter logger.

@jcchavezs
Copy link
Contributor

We did something similar for the HTTP client, could you at least explain more the use case and why it can't be solved with the current logger (maybe convenience or actual technical challenge).

@basvanbeek
Copy link
Member

closing as related to / subset of #37

@fho
Copy link
Author

fho commented Aug 17, 2020

@jcchavezs We use in our applications a different logger then the one from the stdlib.
Currently it is not possible to log messages from zipkin-go to our logger. It's only possible to log messages to the stdlib logger.

I want to use our logger because it e.g. prints messages in JSON-format to stdout.

@basvanbeek
Copy link
Member

@fho the use case you describe fits issue #37 which I'll pick up after my holiday. I am not guaranteeing you can directly use your Printf() method but a simple bridge function in between will be possible.

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

No branches or pull requests

3 participants