Permalink
Browse files

Enable terminal debug logging

  • Loading branch information...
hryniuk committed Apr 17, 2018
1 parent 2614ac9 commit ae6217de83554e9b4e1555f54fdf4006d6eb3ed2
Showing with 67 additions and 0 deletions.
  1. +56 −0 Cargo.lock
  2. +1 −0 Cargo.toml
  3. +10 −0 src/wtftw.rs
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -12,6 +12,7 @@ log = "*"
num = "*"
libc = "*"
dylib = "*"
simplelog = "*"
zombie = "*"
wtftw_core = { path = "core" }
View
@@ -5,6 +5,7 @@ extern crate rustc_serialize;
extern crate wtftw_core;
extern crate wtftw_xlib;
extern crate zombie;
extern crate simplelog;
use std::env;
use std::rc::Rc;
@@ -23,7 +24,16 @@ pub fn parse_window_ids(ids: &str) -> Vec<(Window, u32)> {
}
}
fn init_logger(verbose_mode_enabled: bool) {
let level = if verbose_mode_enabled { simplelog::LevelFilter::Debug } else { simplelog::LevelFilter::Warn };
simplelog::CombinedLogger::init(vec![
simplelog::TermLogger::new(level, simplelog::Config::default()).unwrap(),
]).unwrap();
}
fn main() {
init_logger(true);
// Parse command line arguments
let args : Vec<String> = env::args().collect();

0 comments on commit ae6217d

Please sign in to comment.