mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-13 07:41:11 +01:00
Use pretty logging at high -vvvv
This commit is contained in:
parent
2c840f4a2d
commit
00def9e19a
4 changed files with 18 additions and 8 deletions
|
@ -85,7 +85,7 @@ pub fn get_args(tagged_filterer: bool) -> Result<ArgMatches<'static>> {
|
|||
.long("debounce"))
|
||||
.arg(Arg::with_name("verbose")
|
||||
.help_heading(Some(OPTSET_DEBUGGING))
|
||||
.help("Print debugging messages (-v, -vv, -vvv; use -vvv for bug reports)")
|
||||
.help("Print debugging messages (-v, -vv, -vvv, -vvvv; use -vvv for bug reports)")
|
||||
.multiple(true)
|
||||
.short("v")
|
||||
.long("verbose"))
|
||||
|
|
|
@ -26,15 +26,25 @@ async fn main() -> Result<()> {
|
|||
|
||||
let args = args::get_args(tagged_filterer)?;
|
||||
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(match args.occurrences_of("verbose") {
|
||||
{
|
||||
let verbosity = args.occurrences_of("verbose");
|
||||
let mut builder = tracing_subscriber::fmt().with_env_filter(match verbosity {
|
||||
0 => "watchexec-cli=warn",
|
||||
1 => "watchexec=debug,watchexec-cli=debug",
|
||||
2 => "watchexec=trace,watchexec-cli=trace",
|
||||
_ => "trace",
|
||||
})
|
||||
.try_init()
|
||||
.ok();
|
||||
});
|
||||
|
||||
if verbosity > 2 {
|
||||
builder = builder.with_span_events(tracing_subscriber::fmt::format::FmtSpan::FULL);
|
||||
}
|
||||
|
||||
if verbosity > 3 {
|
||||
builder.pretty().try_init().ok();
|
||||
} else {
|
||||
builder.try_init().ok();
|
||||
}
|
||||
}
|
||||
|
||||
let init = config::init(&args)?;
|
||||
let mut runtime = config::runtime(&args)?;
|
||||
|
|
|
@ -25,7 +25,7 @@ FLAGS:
|
|||
--print-events Print events that trigger actions
|
||||
-r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart
|
||||
-V, --version Prints version information
|
||||
-v, --verbose Print debugging messages (-v, -vv, -vvv; use -vvv for bug reports)
|
||||
-v, --verbose Print debugging messages (-v, -vv, -vvv, -vvvv; use -vvv for bug reports)
|
||||
|
||||
OPTIONS:
|
||||
-d, --debounce <milliseconds> Set the timeout between detected change and command execution, defaults to
|
||||
|
|
|
@ -25,7 +25,7 @@ FLAGS:
|
|||
--print-events Print events that trigger actions
|
||||
-r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart
|
||||
-V, --version Prints version information
|
||||
-v, --verbose Print debugging messages (-v, -vv, -vvv; use -vvv for bug reports)
|
||||
-v, --verbose Print debugging messages (-v, -vv, -vvv, -vvvv; use -vvv for bug reports)
|
||||
|
||||
OPTIONS:
|
||||
-d, --debounce <milliseconds> Set the timeout between detected change and command execution, defaults to
|
||||
|
|
Loading…
Reference in a new issue