diff --git a/apps/desktop/desktop_native/Cargo.lock b/apps/desktop/desktop_native/Cargo.lock index 0c537d077dd..0aa040bbcf1 100644 --- a/apps/desktop/desktop_native/Cargo.lock +++ b/apps/desktop/desktop_native/Cargo.lock @@ -2586,6 +2586,7 @@ dependencies = [ "ctor 0.5.0", "desktop_core", "libc", + "tracing", ] [[package]] diff --git a/apps/desktop/desktop_native/Cargo.toml b/apps/desktop/desktop_native/Cargo.toml index 3370a940a98..855b0b3aa43 100644 --- a/apps/desktop/desktop_native/Cargo.toml +++ b/apps/desktop/desktop_native/Cargo.toml @@ -79,6 +79,10 @@ zbus_polkit = "=5.0.0" zeroizing-alloc = "=0.1.0" [workspace.lints.clippy] +# Dis-allow println and eprintln, which are typically used in debugging. +# Use `tracing` and `tracing-subscriber` crates for observability needs. +print_stderr = "deny" +print_stdout = "deny" +string_slice = "warn" unused_async = "deny" unwrap_used = "deny" -string_slice = "warn" diff --git a/apps/desktop/desktop_native/autotype/src/windows.rs b/apps/desktop/desktop_native/autotype/src/windows.rs index 1e125ef8e21..01270e7971d 100644 --- a/apps/desktop/desktop_native/autotype/src/windows.rs +++ b/apps/desktop/desktop_native/autotype/src/windows.rs @@ -331,7 +331,6 @@ mod tests { fn get_alphabetic_hot_key_happy() { for c in ('a'..='z').chain('A'..='Z') { let letter = c.to_string(); - println!("{}", letter); let converted = get_alphabetic_hotkey(letter).unwrap(); assert_eq!(converted, c as u16); } diff --git a/apps/desktop/desktop_native/process_isolation/Cargo.toml b/apps/desktop/desktop_native/process_isolation/Cargo.toml index 8e4072f1a90..170832c2fde 100644 --- a/apps/desktop/desktop_native/process_isolation/Cargo.toml +++ b/apps/desktop/desktop_native/process_isolation/Cargo.toml @@ -12,3 +12,4 @@ crate-type = ["cdylib"] ctor = { workspace = true } desktop_core = { path = "../core" } libc = { workspace = true } +tracing = { workspace = true } diff --git a/apps/desktop/desktop_native/process_isolation/src/lib.rs b/apps/desktop/desktop_native/process_isolation/src/lib.rs index 57275817b9f..850ffac841e 100644 --- a/apps/desktop/desktop_native/process_isolation/src/lib.rs +++ b/apps/desktop/desktop_native/process_isolation/src/lib.rs @@ -7,6 +7,7 @@ use desktop_core::process_isolation; use std::{ffi::c_char, sync::LazyLock}; +use tracing::info; static ORIGINAL_UNSETENV: LazyLock i32> = LazyLock::new(|| unsafe { @@ -38,8 +39,8 @@ unsafe extern "C" fn unsetenv(name: *const c_char) -> i32 { #[ctor::ctor] fn preload_init() { let pid = unsafe { libc::getpid() }; + info!(pid, "Enabling memory security for process."); unsafe { - println!("[Process Isolation] Enabling memory security for process {pid}"); process_isolation::isolate_process(); process_isolation::disable_coredumps(); }