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.
tower-hyper uses macros from the
log
crate in asynchronous code internally. This is inflexible and problematic for a library crate: the logger instance oflog
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.