2019-02-22 23:02:15 +00:00
|
|
|
fn main() {
|
|
|
|
// Initialize the cursive logger.
|
|
|
|
cursive::logger::init();
|
|
|
|
|
|
|
|
// Use some logging macros from the `log` crate.
|
2019-05-20 22:45:48 +00:00
|
|
|
log::error!("Something serious probably happened!");
|
|
|
|
log::warn!("Or did it?");
|
|
|
|
log::debug!("Logger initialized.");
|
|
|
|
log::info!("Starting!");
|
2019-02-22 23:02:15 +00:00
|
|
|
|
2020-04-15 19:20:50 +00:00
|
|
|
let mut siv = cursive::default();
|
2019-02-22 23:02:15 +00:00
|
|
|
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);
|
|
|
|
|
2019-05-20 22:45:48 +00:00
|
|
|
siv.add_global_callback('l', |_| log::trace!("Wooo"));
|
2019-02-22 23:02:15 +00:00
|
|
|
|
|
|
|
siv.run();
|
|
|
|
}
|