diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index cda28d13..265a9ee8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,6 +19,9 @@ #[macro_use] extern crate alacritty; +#[macro_use] +extern crate log; + use std::error::Error; use std::sync::Arc; @@ -27,12 +30,14 @@ use alacritty::config::{self, Config}; use alacritty::display::Display; use alacritty::event; use alacritty::event_loop::{self, EventLoop}; +use alacritty::logging; use alacritty::sync::FairMutex; use alacritty::term::{Term}; use alacritty::tty::{self, process_should_exit}; use alacritty::util::fmt::Red; fn main() { + // Load configuration let config = Config::load().unwrap_or_else(|err| { match err { @@ -55,12 +60,15 @@ fn main() { // Load command line options let options = cli::Options::load(); + // Initialize the logger before entering alacritty main loop + logging::initialize(&options); + // Run alacritty if let Err(err) = run(config, options) { die!("Alacritty encountered an unrecoverable error:\n\n\t{}\n", Red(err)); } - println!("Goodbye"); + info!("Goodbye."); } @@ -69,12 +77,14 @@ fn main() { /// Creates a window, the terminal state, pty, I/O event loop, input processor, /// config change monitor, and runs the main display loop. fn run(mut config: Config, options: cli::Options) -> Result<(), Box<Error>> { + info!("Welcome to Alacritty."); + // Create a display. // // The display manages a window and can draw the terminal let mut display = Display::new(&config, &options)?; - println!( + info!( "PTY Dimensions: {:?} x {:?}", display.size().lines(), display.size().cols() |