Skip to content

Commit 6313e58

Browse files
authored
EIM-391 gui now correctly interprets the -v param (#309)
1 parent 2473792 commit 6313e58

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src-tauri/src/cli/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,12 @@ pub async fn run_cli(cli: Cli) -> anyhow::Result<()> {
560560
Commands::Gui(_install_args) => {
561561
#[cfg(not(feature = "gui"))]
562562
unimplemented!("GUI not present in this type of build");
563-
gui::run();
563+
let log_level = match cli.verbose {
564+
0 => LevelFilter::Info,
565+
1 => LevelFilter::Debug,
566+
_ => LevelFilter::Trace,
567+
};
568+
gui::run(Some(log_level));
564569
Ok(())
565570
}
566571
Commands::InstallDrivers => {

src-tauri/src/gui/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ fn is_process_running(pid: u32) -> bool {
180180
}
181181

182182
#[cfg_attr(mobile, tauri::mobile_entry_point)]
183-
pub fn run() {
183+
pub fn run(leg_level_override: Option<log::LevelFilter>) {
184184
// this is here because macos bundled .app does not inherit path
185185
#[cfg(target_os = "macos")]
186186
{
@@ -207,9 +207,9 @@ pub fn run() {
207207
file_name: Some("eim_gui_log".to_string()),
208208
},
209209
))
210-
.level(log::LevelFilter::Info)
211-
.level_for("idf_im_lib", log::LevelFilter::Info)
212-
.level_for("eim_lib", log::LevelFilter::Info)
210+
.level(leg_level_override.unwrap_or(log::LevelFilter::Info))
211+
.level_for("idf_im_lib", leg_level_override.unwrap_or(log::LevelFilter::Info))
212+
.level_for("eim_lib", leg_level_override.unwrap_or(log::LevelFilter::Info))
213213
.build(),
214214
)
215215
.plugin(tauri_plugin_dialog::init())

src-tauri/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ async fn main() {
137137
#[cfg(not(feature = "cli"))]
138138
{
139139
set_locale(&None);
140-
gui::run();
140+
gui::run(None);
141141
}
142142
// both GUI and CLI features are enabled
143143
#[cfg(target_os = "windows")]

0 commit comments

Comments
 (0)