mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-17 01:28:30 +01:00
22 lines
497 B
Rust
22 lines
497 B
Rust
use std::io::Write;
|
|
|
|
// until args.rs is removed from the lib
|
|
pub(crate) use watchexec::{error, config};
|
|
|
|
mod args;
|
|
|
|
fn main() -> error::Result<()> {
|
|
#[allow(deprecated)]
|
|
let (args, loglevel) = args::get_args()?;
|
|
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();
|
|
}
|