Repository: pkolaczk/fclones (language: rust)

Issue:
Change to group progress output in 0.33.0 breaks piping to file via stdout
After update to 0.33.0, when piping the output of `fclones group`  to a file per the examples in the readme (i.e. `$ fclones group . >dupes.txt` the resulting dupes.txt file contains the text during the scanning phases and will not work for input to other `fclones` commands.

Using `fclones group -o dupes.txt` does work as expected.


Discussion / hints:
Sample file showing the issue: [dupes.txt](https://github.com/pkolaczk/fclones/files/13064160/dupes.txt)


Fix patch:
diff --git a/fclones/src/log.rs b/fclones/src/log.rs
index e68ab9f..789b60a 100644
--- a/fclones/src/log.rs
+++ b/fclones/src/log.rs
@@ -134,7 +134,7 @@ impl StdLog {
     /// Does not interfere with progress bar.
     fn eprintln<I: Display>(&self, msg: I) {
         match self.progress_bar.lock().unwrap().upgrade() {
-            Some(pb) if pb.is_visible() => pb.println(format!("{msg}")),
+            Some(pb) if pb.is_visible() => pb.eprintln(format!("{msg}")),
             _ if self.log_stderr_to_stdout => println!("{msg}"),
             _ => eprintln!("{msg}"),
         }
diff --git a/fclones/src/progress.rs b/fclones/src/progress.rs
index 6877d43..e69b91f 100644
--- a/fclones/src/progress.rs
+++ b/fclones/src/progress.rs
@@ -171,10 +171,10 @@ impl ProgressBar {
         self.status_line.is_visible()
     }
 
-    pub fn println<I: AsRef<str>>(&self, msg: I) {
+    pub fn eprintln<I: AsRef<str>>(&self, msg: I) {
         let was_visible = self.status_line.is_visible();
         self.status_line.set_visible(false);
-        println!("{}", msg.as_ref());
+        eprintln!("{}", msg.as_ref());
         self.status_line.set_visible(was_visible);
     }
 


Test patch: