I want to turn off and on logs in the same module selectively (some part of code should have logs, some other part don't) and add custom fields to each log without propagating those fields to log::{warn,info,debug, ...} usages. Intuitively, fastrace integration should do this, however:
let span = Span::root("root", SpanContext::random()).with_property(|| ("component", "database"));
async move {
log::info!("Test");
}.in_span(span).await;
Doesn't report component=database. How can I achieve that properly? I can't use Metadata::target (can I? As far as I can see, target represents crate name), since everything occurs in the same crate.
And logforth lacks some explanations, as an example:
Metadata::target
Get the target
What's the target?