Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): retain log verbosity when running a mobile IDE script #11186

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changes/ide-commands-verbosity.md
Original file line number Diff line number Diff line change
@@ -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.

9 changes: 8 additions & 1 deletion crates/tauri-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Loading