mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-09 19:00:46 +00:00
20 lines
673 B
Rust
20 lines
673 B
Rust
fn main() {
|
|
// Initialize the cursive logger.
|
|
cursive::logger::init();
|
|
|
|
// Use some logging macros from the `log` crate.
|
|
log::error!("Something serious probably happened!");
|
|
log::warn!("Or did it?");
|
|
log::debug!("Logger initialized.");
|
|
log::info!("Starting!");
|
|
|
|
let mut siv = cursive::Cursive::default();
|
|
siv.add_layer(cursive::views::Dialog::text("Press ~ to open the console.\nPress l to generate logs.\nPress q to quit."));
|
|
siv.add_global_callback('q', cursive::Cursive::quit);
|
|
siv.add_global_callback('~', cursive::Cursive::toggle_debug_console);
|
|
|
|
siv.add_global_callback('l', |_| log::trace!("Wooo"));
|
|
|
|
siv.run();
|
|
}
|