watchexec/src/main.rs

22 lines
449 B
Rust
Raw Normal View History

use std::io::Write;
extern crate watchexec;
2019-01-26 03:15:27 +01:00
use watchexec::{cli, error, run};
2016-09-14 15:30:59 +02:00
fn main() -> error::Result<()> {
2021-04-10 15:09:28 +02:00
#[allow(deprecated)]
let (args, loglevel) = cli::get_args()?;
init_logger(loglevel);
run(args)
}
fn init_logger(level: log::LevelFilter) {
let mut log_builder = env_logger::Builder::new();
log_builder
.format(|buf, r| writeln!(buf, "*** {}", r.args()))
.filter(None, level)
.init();
}