From 3a9fe62c4817dbf2545f7f7af7278f7f78093a1c Mon Sep 17 00:00:00 2001 From: neuronull <9162534+neuronull@users.noreply.github.com> Date: Mon, 15 Sep 2025 19:57:47 -0600 Subject: [PATCH] convert printlns in core/password crate --- .../desktop_native/core/src/password/unix.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/desktop/desktop_native/core/src/password/unix.rs b/apps/desktop/desktop_native/core/src/password/unix.rs index 0b1c59e7724..b7595dca287 100644 --- a/apps/desktop/desktop_native/core/src/password/unix.rs +++ b/apps/desktop/desktop_native/core/src/password/unix.rs @@ -2,6 +2,7 @@ use crate::password::PASSWORD_NOT_FOUND; use anyhow::{anyhow, Result}; use oo7::dbus::{self}; use std::collections::HashMap; +use tracing::info; pub async fn get_password(service: &str, account: &str) -> Result { match get_password_new(service, account).await { @@ -27,7 +28,7 @@ async fn get_password_new(service: &str, account: &str) -> Result { // forces to read via secret service; remvove after 2025.03 async fn get_password_legacy(service: &str, account: &str) -> Result { - println!("falling back to get legacy {} {}", service, account); + info!("falling back to get legacy {} {}", service, account); let svc = dbus::Service::new().await?; let collection = svc.default_collection().await?; let keyring = oo7::Keyring::DBus(collection); @@ -38,10 +39,7 @@ async fn get_password_legacy(service: &str, account: &str) -> Result { match res { Some(res) => { let secret = res.secret().await?; - println!( - "deleting legacy secret service entry {} {}", - service, account - ); + info!(service, account, "deleting legacy secret service entry",); keyring.delete(&attributes).await?; let secret_string = String::from_utf8(secret.to_vec())?; set_password(service, account, &secret_string).await?; @@ -77,7 +75,7 @@ pub async fn delete_password(service: &str, account: &str) -> Result<()> { // seems to happen because we call [delete_password] many times when a forced // de-auth occurs to clean up old keys. if is_locked().await? { - println!("skipping deletion of old keys. OS keyring is locked."); + info!("skipping deletion of old keys. OS keyring is locked."); return Ok(()); } @@ -105,11 +103,11 @@ pub async fn is_locked() -> Result { if let Some(item) = items.first() { return match item.is_locked().await { Ok(is_locked) => { - println!("OS keyring is locked = {is_locked}"); + info!(is_locked, "OS keyring"); Ok(is_locked) } Err(_) => { - println!("OS keyring is unlocked"); + info!("OS keyring is unlocked"); Ok(false) } };