watchexec/src/main.rs

23 lines
497 B
Rust
Raw Normal View History

use std::io::Write;
// until args.rs is removed from the lib
pub(crate) use watchexec::{error, config};
2019-01-26 03:15:27 +01:00
mod args;
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) = args::get_args()?;
2021-04-10 15:09:28 +02:00
init_logger(loglevel);
watchexec::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();
}