extern crate ansi_term;
#[macro_use] extern crate log;
extern crate loggerv;
extern crate clap;
use clap::{Arg, App};
fn main() {
#[cfg(windows)] ansi_term::enable_ansi_support().unwrap();
let args = App::new("app")
.arg(Arg::with_name("v")
.short("v")
.multiple(true)
.help("Sets the level of verbosity"))
.arg(Arg::with_name("debug")
.short("d")
.long("debug")
.help("Adds the line numbers to log statements"))
.arg(Arg::with_name("no-module-path")
.long("no-module-path")
.help("Disables the module path in the log statements"))
.arg(Arg::with_name("no-color")
.long("no-color")
.help("Disables colorized output"))
.arg(Arg::with_name("level")
.short("l")
.long("level")
.help("Adds the log level to the log statements. This will also surround the module path in square brackets."))
.get_matches();
loggerv::Logger::new()
.verbosity(args.occurrences_of("v"))
.level(args.is_present("level"))
.line_numbers(args.is_present("debug"))
.module_path(!args.is_present("no-module-path"))
.colors(!args.is_present("no-color"))
.init()
.unwrap();
error!("This is always printed to stderr");
warn!("This too is always printed to stderr");
info!("This is optionally printed to stdout based on the verbosity");
debug!("This is optionally printed to stdout based on the verbosity");
trace!("This is optionally printed to stdout based on the verbosity");
}