pub fn toggle_flexi_logger_debug_console(siv: &mut Cursive)Expand description
Show the flexi_logger debug console, or hide it if it’s already visible.
This is analog to Cursive::toggle_debug_console.
§Enable toggleable flexi_logger debug view
use cursive::{Cursive, CursiveExt};
use cursive_flexi_logger_view::toggle_flexi_logger_debug_console;
use flexi_logger::Logger;
fn main() {
// we need to initialize cursive first, as the cursive-flexi-logger
// needs a cursive callback sink to notify cursive about screen refreshs
// when a new log message arrives
let mut siv = Cursive::default();
Logger::try_with_env_or_str("trace")
.expect("Could not create Logger from environment :(")
.log_to_file_and_writer(
flexi_logger::FileSpec::default()
.directory("logs")
.suppress_timestamp(),
cursive_flexi_logger_view::cursive_flexi_logger(&siv)
)
.format(flexi_logger::colored_with_thread)
.start()
.expect("failed to initialize logger!");
siv.add_global_callback('~', toggle_flexi_logger_debug_console); // Enable toggleable flexi_logger debug view
// siv.run();
}