2020-06-24 16:17:59 +02:00
|
|
|
use std::io::Write;
|
|
|
|
|
2021-04-10 15:33:40 +02:00
|
|
|
// until args.rs is removed from the lib
|
|
|
|
pub(crate) use watchexec::{error, config};
|
2019-01-26 03:15:27 +01:00
|
|
|
|
2021-04-10 15:33:40 +02:00
|
|
|
mod args;
|
2016-09-14 15:30:59 +02:00
|
|
|
|
2018-09-08 13:51:44 +02:00
|
|
|
fn main() -> error::Result<()> {
|
2021-04-10 15:09:28 +02:00
|
|
|
#[allow(deprecated)]
|
2021-04-10 15:33:40 +02:00
|
|
|
let (args, loglevel) = args::get_args()?;
|
2021-04-10 15:09:28 +02:00
|
|
|
init_logger(loglevel);
|
2021-04-10 15:33:40 +02:00
|
|
|
watchexec::run(args)
|
2017-01-27 21:27:44 +01:00
|
|
|
}
|
2020-06-24 16:17:59 +02:00
|
|
|
|
2021-04-08 19:52:44 +02:00
|
|
|
fn init_logger(level: log::LevelFilter) {
|
2020-06-24 16:17:59 +02:00
|
|
|
let mut log_builder = env_logger::Builder::new();
|
|
|
|
|
|
|
|
log_builder
|
|
|
|
.format(|buf, r| writeln!(buf, "*** {}", r.args()))
|
|
|
|
.filter(None, level)
|
|
|
|
.init();
|
|
|
|
}
|