From 72ae6c0fe716216a416307f8d72e947723fd106d Mon Sep 17 00:00:00 2001 From: neuronull <9162534+neuronull@users.noreply.github.com> Date: Mon, 15 Sep 2025 19:47:45 -0600 Subject: [PATCH] convert printlns in autotype crate --- apps/desktop/desktop_native/Cargo.lock | 1 + apps/desktop/desktop_native/autotype/Cargo.toml | 1 + apps/desktop/desktop_native/autotype/src/windows.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/desktop/desktop_native/Cargo.lock b/apps/desktop/desktop_native/Cargo.lock index 4c4c463bd13..0b85f9b5de3 100644 --- a/apps/desktop/desktop_native/Cargo.lock +++ b/apps/desktop/desktop_native/Cargo.lock @@ -353,6 +353,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" name = "autotype" version = "0.0.0" dependencies = [ + "tracing", "windows 0.61.1", "windows-core 0.61.0", ] diff --git a/apps/desktop/desktop_native/autotype/Cargo.toml b/apps/desktop/desktop_native/autotype/Cargo.toml index de026a3ddd8..ceccd0c890a 100644 --- a/apps/desktop/desktop_native/autotype/Cargo.toml +++ b/apps/desktop/desktop_native/autotype/Cargo.toml @@ -6,6 +6,7 @@ edition.workspace = true publish.workspace = true [target.'cfg(windows)'.dependencies] +tracing.workspace = true windows = { workspace = true, features = [ "Win32_UI_Input_KeyboardAndMouse", "Win32_UI_WindowsAndMessaging", diff --git a/apps/desktop/desktop_native/autotype/src/windows.rs b/apps/desktop/desktop_native/autotype/src/windows.rs index dba0251ed82..8e156165936 100644 --- a/apps/desktop/desktop_native/autotype/src/windows.rs +++ b/apps/desktop/desktop_native/autotype/src/windows.rs @@ -1,6 +1,7 @@ use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; +use tracing::debug; use windows::Win32::Foundation::{GetLastError, HWND}; use windows::Win32::UI::Input::KeyboardAndMouse::{ SendInput, INPUT, INPUT_0, INPUT_KEYBOARD, KEYBDINPUT, KEYEVENTF_KEYUP, KEYEVENTF_UNICODE, @@ -187,7 +188,7 @@ fn send_input(inputs: Vec) -> Result<(), ()> { let insert_count = unsafe { SendInput(&inputs, std::mem::size_of::() as i32) }; let e = unsafe { GetLastError().to_hresult().message() }; - println!("type_input() called, GetLastError() is: {:?}", e); + debug!("type_input() called, GetLastError() is: {:?}", e); if insert_count == 0 { return Err(()); // input was blocked by another thread