mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +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();
|
|
}
|