use std::sync::Once;
use tracing::subscriber::{Interest, Subscriber};
use tracing::{Event, Metadata, span};
struct KeepAsking;
impl Subscriber for KeepAsking {
fn register_callsite(&self, _: &'static Metadata<'static>) -> Interest {
Interest::sometimes()
}
fn enabled(&self, _: &Metadata<'_>) -> bool {
false
}
fn new_span(&self, _: &span::Attributes<'_>) -> span::Id {
span::Id::from_u64(1)
}
fn record(&self, _: &span::Id, _: &span::Record<'_>) {}
fn record_follows_from(&self, _: &span::Id, _: &span::Id) {}
fn event(&self, _: &Event<'_>) {}
fn enter(&self, _: &span::Id) {}
fn exit(&self, _: &span::Id) {}
}
pub(crate) fn keep_callsites_answerable() {
static INSTALLED: Once = Once::new();
INSTALLED.call_once(|| {
let _ = tracing::subscriber::set_global_default(KeepAsking);
});
}