Skip to content

Commit 56dbd04

Browse files
committed
log: also log process name in toggle_all
1 parent 0075f28 commit 56dbd04

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/utils/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use win32_ecoqos::{
55
windows_result,
66
};
77

8-
use crate::{bypass::should_bypass, logging::log_warn};
8+
use crate::bypass::should_bypass;
99

1010
pub fn process_child_process(enable: Option<bool>, pid: u32) -> windows_result::Result<()> {
1111
let action = match enable {
@@ -62,10 +62,12 @@ pub fn toggle_all(enable: Option<bool>) -> windows_result::Result<()> {
6262
..
6363
} in Processes::try_new()?
6464
{
65-
if should_bypass(process_name) {
65+
if should_bypass(&process_name) {
6666
continue;
6767
}
68-
_ = toggle_efficiency_mode(pid, enable).inspect_err(log_warn);
68+
if let Err(e) = toggle_efficiency_mode(pid, enable) {
69+
warn!("failed to toggle {process_name:?}: {e}");
70+
}
6971
}
7072

7173
Ok(())

0 commit comments

Comments
 (0)