impl Dispatch {
/// Returns a `Dispatch` that forwards to the given [`Subscriber`].
///
/// [`Subscriber`]: super::subscriber::Subscriber
pub fn new<S>(subscriber: S) -> Self
where
S: Subscriber + Send + Sync + 'static,
{
let me = Dispatch {
subscriber: Kind::Scoped(Arc::new(subscriber)),
};
callsite::register_dispatch(&me);
me
}
}
It should be moved to a new function like register_dispatch and get called in dispatcher::set_global_default
and similar functions
Not hidden in self.into() like in tracing_susbcriber
Dispatch::new is not side-effect-free.
It should be moved to a new function like
register_dispatch
and get called indispatcher::set_global_default
and similar functions Not hidden inself.into()
like in tracing_susbcriberhttps://github.com/tokio-rs/tracing/blame/690a9a68098aa1eb86d1c5c4aad085ef12245bca/tracing-core/src/dispatch.rs#L545
https://github.com/JakkuSakura/tracing-shared-rs/issues/2