From 8f6b88f3de3f433df8f7c7283359789765257702 Mon Sep 17 00:00:00 2001 From: "Rene D. Obermueller" Date: Sun, 5 Apr 2026 11:04:23 +0200 Subject: [PATCH] fix: replace println! with eprintln! Closes: #478 --- src/femtovg_area/imp.rs | 6 +++--- src/main.rs | 2 +- src/notification.rs | 2 +- src/sketch_board.rs | 11 +++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/femtovg_area/imp.rs b/src/femtovg_area/imp.rs index f33fa1f..e847dd2 100644 --- a/src/femtovg_area/imp.rs +++ b/src/femtovg_area/imp.rs @@ -128,7 +128,7 @@ impl GLAreaImpl for FemtoVGArea { { Ok(t) => t, Err(e) => { - println!("Error while rendering image: {e}"); + eprintln!("Error while rendering image: {e}"); return glib::Propagation::Stop; } }; @@ -149,7 +149,7 @@ impl GLAreaImpl for FemtoVGArea { .expect("Did you call init before using FemtoVgArea?") .render_framebuffer(canvas, font) { - println!("Error rendering to framebuffer: {e}"); + eprintln!("Error rendering to framebuffer: {e}"); } glib::Propagation::Stop } @@ -217,7 +217,7 @@ impl FemtoVGArea { loaded_fonts.push(id); } Err(e) => { - println!("Error while loading font. Using default font: {e}"); + eprintln!("Error while loading font. Using default font: {e}"); } } } diff --git a/src/main.rs b/src/main.rs index 114c599..250d5c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -191,7 +191,7 @@ impl App { gtk::style_context_add_provider_for_display(&display, &css_provider2, 1) } } - None => println!("Cannot apply style"), + None => eprintln!("Cannot apply style"), } } } diff --git a/src/notification.rs b/src/notification.rs index cc8d8d7..d511257 100644 --- a/src/notification.rs +++ b/src/notification.rs @@ -4,7 +4,7 @@ use relm4::gtk::gio::{Notification, prelude::ApplicationExt}; use relm4::gtk::{IconLookupFlags, IconTheme, TextDirection}; pub fn log_result(msg: &str, notify: bool) { - println!("{msg}"); + eprintln!("{msg}"); if notify { show_notification(msg); } diff --git a/src/sketch_board.rs b/src/sketch_board.rs index b63c7de..988d39f 100644 --- a/src/sketch_board.rs +++ b/src/sketch_board.rs @@ -368,7 +368,7 @@ impl SketchBoard { fn handle_save(&self, image: &Pixbuf) { let mut output_filename = match APP_CONFIG.read().output_filename() { None => { - println!("No Output filename specified!"); + eprintln!("No Output filename specified!"); return; } Some(o) => o.clone(), @@ -381,7 +381,7 @@ impl SketchBoard { }); if result.is_err() { - println!( + eprintln!( "Warning: Could not format filename {output_filename} due to chrono format error, falling back to literal filename." ); } else { @@ -416,7 +416,7 @@ impl SketchBoard { let data = match image.save_to_bufferv("png", &Vec::new()) { Ok(d) => d, Err(e) => { - println!("Error serializing image: {e}"); + eprintln!("Error serializing image: {e}"); return; } }; @@ -456,7 +456,7 @@ impl SketchBoard { let data = match pixbuf.save_to_bufferv("png", &Vec::new()) { Ok(d) => d, Err(e) => { - println!("Error serializing image: {e}"); + eprintln!("Error serializing image: {e}"); return; } }; @@ -566,7 +566,7 @@ impl SketchBoard { }; match result { - Err(e) => println!("Error saving {e}"), + Err(e) => eprintln!("Error saving {e}"), Ok(()) => { log_result( "Copied to clipboard.", @@ -1142,7 +1142,6 @@ impl Component for SketchBoard { } }; - // println!(" Result={:?}", result); match result { ToolUpdateResult::Commit(drawable) => { self.renderer.commit(drawable);