Fix tracing output

Signed-off-by: trivernis <trivernis@protonmail.com>
i18n
trivernis 2 years ago
parent 6d2fb4342d
commit 7a446226ec
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -95,8 +95,8 @@ impl<S: Subscriber + for<'a> LookupSpan<'a>> Layer<S> for AmeFormatLayer {
}
}
fn on_exit(&self, id: &span::Id, ctx: tracing_subscriber::layer::Context<'_, S>) {
let span = ctx.span(id).unwrap();
fn on_close(&self, id: span::Id, ctx: tracing_subscriber::layer::Context<'_, S>) {
let span = ctx.span(&id).unwrap();
let metadata = span.metadata();
if self.is_enabled(metadata) {

@ -108,7 +108,6 @@ impl LogHandler {
(*self.level.write()) = level;
}
#[tracing::instrument(level = "trace", skip_all)]
pub fn reset_output_type(&self) {
self.set_output_type(OutputType::Stdout);
}
@ -141,7 +140,6 @@ impl LogHandler {
}
/// Creates a new progress spinner and registers it on the log handler
#[tracing::instrument(level = "trace", skip_all)]
pub fn new_progress_spinner(&self) -> Arc<ProgressBar> {
let pb = ProgressBar::new_spinner();
pb.enable_steady_tick(Duration::from_millis(250));
@ -158,7 +156,6 @@ impl LogHandler {
}
}
#[tracing::instrument(level = "trace", skip_all)]
pub fn new_multi_progress(&self) -> Arc<MultiProgress> {
let mp = Arc::new(MultiProgress::new());
self.set_output_type(OutputType::MultiProgress(mp.clone()));
@ -166,14 +163,7 @@ impl LogHandler {
mp
}
/// Registeres a progress bar on the log handler
#[tracing::instrument(level = "trace", skip_all)]
fn set_progress_bar(&self, pb: Arc<ProgressBar>) {
self.set_output_type(OutputType::Progress(pb))
}
/// Sets the output type of the log handler to either stdout/stderr or a progress bar
#[tracing::instrument(level = "trace", skip_all)]
pub fn set_output_type(&self, mut output: OutputType) {
{
let mut output_type = self.output_type.write();

Loading…
Cancel
Save