kubert icon indicating copy to clipboard operation
kubert copied to clipboard

log: add tokio-console support

Open hawkw opened this issue 3 years ago • 0 comments

This branch adds initial support for setting up the Tokio console to track tasks in a Kubert controller. In order to do so, I added a new LogArgs struct in the log module to represent a logging configuration that can be parsed using clap, including a flag for enabling tokio-console support. When this flag is present, and the requisite kubert feature and RUSTFLAGS="--cfg tokio_unstable" are enabled, the Tokio console server is enabled.

Additionally, the new LogArgs struct handles parsing the LogFormat and tracing_subscriber::EnvFilter arguments. The LogArgs type uses a custom clap::FromArgs implementation so that the default value for the filter can include the name of the binary itself.

Finally, I added support for spawning named tasks using the unstable tokio::task::Builder API, when the tokio_unstable cfg is enabled. These task names will show up in the console when the cfg is enabled.

hawkw avatar Apr 19 '22 17:04 hawkw