tracing: use structured location fields for spawned tasks (#4128)

This change enables `tokio-console` to parse the location information
for a spawned task into a structured object rather than simply displaying
this info as a field on the task.

Signed-off-by: Zahari Dichev <[email protected]>
This commit is contained in:
Zahari Dichev
2021-09-22 23:17:41 +03:00
committed by GitHub
parent cdc46a9ded
commit b9b59e4f15
+3 -1
View File
@@ -14,7 +14,9 @@ cfg_trace! {
"runtime.spawn",
%kind,
task.name = %name.unwrap_or_default(),
spawn.location = %format_args!("{}:{}:{}", location.file(), location.line(), location.column()),
loc.file = location.file(),
loc.line = location.line(),
loc.col = location.column(),
);
#[cfg(not(tokio_track_caller))]
let span = tracing::trace_span!(