subscriber: Forward current_span impl for Layered (#350)

This overrides the default `Subscriber::current_span` impl
with one that forwards the inner subscribers implementation.
This fixes bugs where the current_span was not fetchable when
using the `FmtSubscriber`.

Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
This commit is contained in:
Lucio Franco 2019-09-16 16:58:12 -04:00 committed by Eliza Weisman
parent cc70560a75
commit 67689dfe21

View File

@ -501,6 +501,11 @@ where
} }
} }
#[inline]
fn current_span(&self) -> span::Current {
self.inner.current_span()
}
#[doc(hidden)] #[doc(hidden)]
unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()> { unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()> {
self.layer self.layer