executor work

This commit is contained in:
John Smith
2022-06-27 23:46:29 -04:00
parent ebea72c9db
commit fdbb4c6397
59 changed files with 726 additions and 640 deletions
+1 -19
View File
@@ -97,24 +97,6 @@ impl ApiTracingLayer {
}
}
fn display_current_thread_id() -> String {
cfg_if! {
if #[cfg(target_arch = "wasm32")] {
"".to_owned()
} else {
format!("({}:{:?})",
if let Some(n) = async_std::task::current().name() {
n.to_string()
}
else {
async_std::task::current().id().to_string()
},
std::thread::current().id()
)
}
}
}
impl<S: Subscriber + for<'a> registry::LookupSpan<'a>> Layer<S> for ApiTracingLayer {
fn enabled(&self, metadata: &tracing::Metadata<'_>, _: layer::Context<'_, S>) -> bool {
if let Some(inner) = &mut *self.inner.lock() {
@@ -188,7 +170,7 @@ impl<S: Subscriber + for<'a> registry::LookupSpan<'a>> Layer<S> for ApiTracingLa
.and_then(|file| meta.line().map(|ln| format!("{}:{}", file, ln)))
.unwrap_or_default();
let message = format!("{}{} {}", origin, display_current_thread_id(), recorder);
let message = format!("{} {}", origin, recorder);
(inner.update_callback)(VeilidUpdate::Log(VeilidStateLog {
log_level,