pub fn set_debug(enable: bool)Expand description
Set debug mode or not, false by default.
This is global, and affects all threads. To set it for the current thread only, use ScopedDebug.
Setting environment variable CMD_LIB_DEBUG=0|1 has the same effect, but the environment variable is only checked once at an unspecified time, so the only reliable way to do that is when the program is first started.
§Example
λ test_cmd_lib git:(master) ✗ cat src/main.rs
use cmd_lib::*;
#[cmd_lib::main]
fn main() -> CmdResult {
run_cmd!(cat src/main.rs | wc -l)
}
λ test_cmd_lib git:(master) ✗ RUST_LOG=debug CMD_LIB_DEBUG=1 cargo r
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/test_cmd_lib`
[DEBUG] Running ["cat" "src/main.rs" | "wc" "-l"] at src/main.rs:5 ...
6