Use pretty logging at high -vvvv
This commit is contained in:
parent
2c840f4a2d
commit
00def9e19a
|
@ -85,7 +85,7 @@ pub fn get_args(tagged_filterer: bool) -> Result<ArgMatches<'static>> {
|
||||||
.long("debounce"))
|
.long("debounce"))
|
||||||
.arg(Arg::with_name("verbose")
|
.arg(Arg::with_name("verbose")
|
||||||
.help_heading(Some(OPTSET_DEBUGGING))
|
.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)
|
.multiple(true)
|
||||||
.short("v")
|
.short("v")
|
||||||
.long("verbose"))
|
.long("verbose"))
|
||||||
|
|
|
@ -26,15 +26,25 @@ async fn main() -> Result<()> {
|
||||||
|
|
||||||
let args = args::get_args(tagged_filterer)?;
|
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",
|
0 => "watchexec-cli=warn",
|
||||||
1 => "watchexec=debug,watchexec-cli=debug",
|
1 => "watchexec=debug,watchexec-cli=debug",
|
||||||
2 => "watchexec=trace,watchexec-cli=trace",
|
2 => "watchexec=trace,watchexec-cli=trace",
|
||||||
_ => "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 init = config::init(&args)?;
|
||||||
let mut runtime = config::runtime(&args)?;
|
let mut runtime = config::runtime(&args)?;
|
||||||
|
|
|
@ -25,7 +25,7 @@ FLAGS:
|
||||||
--print-events Print events that trigger actions
|
--print-events Print events that trigger actions
|
||||||
-r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart
|
-r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart
|
||||||
-V, --version Prints version information
|
-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:
|
OPTIONS:
|
||||||
-d, --debounce <milliseconds> Set the timeout between detected change and command execution, defaults to
|
-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
|
--print-events Print events that trigger actions
|
||||||
-r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart
|
-r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart
|
||||||
-V, --version Prints version information
|
-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:
|
OPTIONS:
|
||||||
-d, --debounce <milliseconds> Set the timeout between detected change and command execution, defaults to
|
-d, --debounce <milliseconds> Set the timeout between detected change and command execution, defaults to
|
||||||
|
|
Loading…
Reference in New Issue