Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Usage of log considered harmful #45

Open
mzabaluev opened this issue Jun 3, 2019 · 2 comments
Open

Usage of log considered harmful #45

mzabaluev opened this issue Jun 3, 2019 · 2 comments

Comments

@mzabaluev
Copy link
Contributor

tower-hyper uses macros from the log crate in asynchronous code internally. This is inflexible and problematic for a library crate: the logger instance of log is set globally in the application, whose developers might not be aware of logging going on in the library, while many popular logger implementations are blocking.

If logging must be done, it would be much better for task-bound structures such as Connect to incorporate an optional, application-settable structural logging context in the style of slog. The API users would then be aware of the logging, be able to add contextual information per instance, and be able to supply a non-blocking frontend such as slog-async.

@mzabaluev
Copy link
Contributor Author

As #52 exposes the connection error through the Connection future, is the debug! statement really needed?

@davidbarsky
Copy link
Collaborator

@mzabaluev I think we'll end up switching to tracing instead for logging purposes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants