logging framework
This commit is contained in:
parent
ab75624667
commit
dd7f14f516
@ -9,3 +9,5 @@ edition = "2018"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
docopt = "1.1.0"
|
docopt = "1.1.0"
|
||||||
serde = "1.0.91"
|
serde = "1.0.91"
|
||||||
|
log = "0.4.6"
|
||||||
|
pretty_env_logger = "0.3.0"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use docopt::Docopt;
|
use docopt::Docopt;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
use log::{debug};
|
||||||
|
|
||||||
static USAGE: &'static str = "
|
static USAGE: &'static str = "
|
||||||
foil
|
foil
|
||||||
@ -28,10 +29,10 @@ struct Args {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
pretty_env_logger::init();
|
||||||
let args: Args = Docopt::new(USAGE)
|
let args: Args = Docopt::new(USAGE)
|
||||||
.and_then(|dopt| dopt.deserialize())
|
.and_then(|dopt| dopt.deserialize())
|
||||||
.unwrap_or_else(|e| e.exit());
|
.unwrap_or_else(|e| e.exit());
|
||||||
println!("{:?}", args);
|
debug!("{:?}", args);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user