diff --git a/.changes/ide-commands-verbosity.md b/.changes/ide-commands-verbosity.md new file mode 100644 index 000000000000..19fabd4e1430 --- /dev/null +++ b/.changes/ide-commands-verbosity.md @@ -0,0 +1,7 @@ +--- +'tauri-cli': 'patch:enhance' +'@tauri-apps/cli': 'patch:enhance' +--- + +Retain logger verbosity on the `android-studio-script` and `xcode-script` commands. + diff --git a/crates/tauri-cli/src/lib.rs b/crates/tauri-cli/src/lib.rs index 2c5be4802b57..2ab75cf95127 100644 --- a/crates/tauri-cli/src/lib.rs +++ b/crates/tauri-cli/src/lib.rs @@ -216,10 +216,17 @@ where Err(e) => e.exit(), }; + let verbosity_number = std::env::var("TAURI_CLI_VERBOSITY") + .ok() + .and_then(|v| v.parse().ok()) + .unwrap_or(cli.verbose); + // set the verbosity level so subsequent CLI calls (xcode-script, android-studio-script) refer to it + std::env::set_var("TAURI_CLI_VERBOSITY", verbosity_number.to_string()); + let mut builder = Builder::from_default_env(); let init_res = builder .format_indent(Some(12)) - .filter(None, verbosity_level(cli.verbose).to_level_filter()) + .filter(None, verbosity_level(verbosity_number).to_level_filter()) .format(|f, record| { let mut is_command_output = false; if let Some(action) = record.key_values().get("action".into()) {