From 5e290acbee30a19de16fb51a65a31f2f9521f503 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 6 Mar 2024 14:05:32 -0800 Subject: [PATCH] Use `log` instead of `println!` --- src/main.rs | 4 ++-- src/wayland/buffer.rs | 2 +- src/wayland/dmabuf.rs | 6 +++--- src/wayland/screencopy.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8ac872e..27e8d4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -450,7 +450,7 @@ impl Application for App { self.update_capture_filter(); } wayland::Event::NewToplevel(handle, info) => { - println!("New toplevel: {info:?}"); + log::debug!("New toplevel: {info:?}"); self.toplevels.push(Toplevel { icon: desktop_info::icon_for_app_id(info.app_id.clone()), handle, @@ -709,7 +709,7 @@ impl Application for App { } } } - println!("NO VIEW"); + log::info!("NO VIEW"); text("workspaces").into() } diff --git a/src/wayland/buffer.rs b/src/wayland/buffer.rs index 842f6e7..ff0af03 100644 --- a/src/wayland/buffer.rs +++ b/src/wayland/buffer.rs @@ -228,7 +228,7 @@ impl AppData { return buffer; } Ok(None) => {} - Err(err) => eprintln!("Failed to create gbm buffer: {}", err), + Err(err) => log::error!("Failed to create gbm buffer: {}", err), } } diff --git a/src/wayland/dmabuf.rs b/src/wayland/dmabuf.rs index 309df4b..3b4a872 100644 --- a/src/wayland/dmabuf.rs +++ b/src/wayland/dmabuf.rs @@ -34,10 +34,10 @@ impl DmabufHandler for AppData { self.gbm = Some(gbm); } Ok(None) => { - eprintln!("Gbm main device '{}' not found", feedback.main_device()); + log::error!("Gbm main device '{}' not found", feedback.main_device()); } Err(err) => { - eprintln!("Failed to open gbm main device: {}", err); + log::error!("Failed to open gbm main device: {}", err); } } } @@ -72,7 +72,7 @@ fn find_gbm_device(dev: u64) -> io::Result, ) { // TODO - println!("Failed"); + log::error!("Screencopy failed"); if let Some(capture) = Capture::for_session(session) { capture.stop(); }