You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnrender(f:&mutsuper::Frame<'_>,rect: tui::layout::Rect){let state = TuiWidgetState::new().set_default_display_level(LevelFilter::Trace);let w = TuiLoggerWidget::default().style_error(Style::default().fg(Color::Red)).style_debug(Style::default().fg(Color::Green)).style_warn(Style::default().fg(Color::Yellow)).style_trace(Style::default().fg(Color::Magenta)).style_info(Style::default().fg(Color::Cyan)).state(&state);
f.render_widget(w, rect);}
I'm not getting any log output if I do this. If I use the SmartWidget, I get the borders but no logs. I'm getting logs in my file from tracing, just not in the TuiLoggerWidget.
Any idea what might be going on here?
The text was updated successfully, but these errors were encountered:
The tracing feature is implemented by #31. If I read the code correctly, then the tracing messages are fed into the log system. So tui_logger needs to be initialized as normal. This means something along the lines of:
// Set max_log_level to Trace
tui_logger::init_logger(log::LevelFilter::Trace).unwrap();
// Set default level for unknown targets to Trace
tui_logger::set_default_level(log::LevelFilter::Trace);
Using this in the code throws an exception on unwrap():
// Set max_log_level to Trace
tui_logger::init_logger(log::LevelFilter::Trace).unwrap();
Here's the error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SetLoggerError(())', src\logging.rs:31:52
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Thanks for putting together this package.
I'm not able to get this to work with tracing unfortunately. Do you have any idea what might be going on?
I have the following code in the
main.rs
:And I'm using the following render function:
I'm not getting any log output if I do this. If I use the SmartWidget, I get the borders but no logs. I'm getting logs in my file from tracing, just not in the TuiLoggerWidget.
Any idea what might be going on here?
The text was updated successfully, but these errors were encountered: