Open hrxi opened 2 years ago
I'm willing to implement any of these solutions or one that you come up with. :)
- Expose setting the hyper::rt::Executor directly on reqwest::ClientBuilder.
This will be great,also solve this issue https://github.com/hyperium/hyper/issues/2112#issuecomment-576416498.
Is your feature request related to a problem? Please describe. I'm trying to build a tracing backend that ships logs via HTTPS requests. I want to disable logging for this tracing backend because allowing logging would cause a positive feedback loop where logs cause more logs to be produced indefinitely.
I can disable logging for the thread that reqwest's future is on. Unfortunately, hyper, the backend for this crate, also
tokio::spawn
s some futures, for which I cannot directly control logging. hyper has some way of controlling the spawning of new tasks, and I can use that to disable logging in background threads as well:(Note that
NoSubscriber
of tracing currently has a bug: https://github.com/tokio-rs/tracing/issues/1999, so you need a copy of its source code to actually stop tracing from logging.)Describe the solution you'd like Possible solutions:
hyper::rt::Executor
directly onreqwest::ClientBuilder
.no_logging
onreqwest::ClientBuilder
that stops hyper's spawned tasks from logging.