Skip to content

Commit

Permalink
fix: log to stderr, not stdout
Browse files Browse the repository at this point in the history
If we log to stdout, we pollute the actual output someone is likely
piping to a file.

Tested: Ran on feeds with producing warnings for skipped entries,
  verified the logs only appear on stdout.

Signed-off-by: Luke Hsiao <[email protected]>
  • Loading branch information
lukehsiao committed Sep 7, 2023
1 parent 445c6d6 commit 9e8a2d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use clap::Parser;
use miette::{Context, Result};
use std::io;

use openring::{self, Args};

Expand All @@ -11,6 +12,7 @@ fn main() -> Result<()> {
"openring={},html5ever=off,ureq=off",
convert_filter(args.verbose.log_level_filter())
))
.with_writer(io::stderr)
.init();
// I feel like I shouldn't need wrap_err, but it doesn't work without it.
openring::run(args).wrap_err("runtime error")
Expand Down

0 comments on commit 9e8a2d6

Please sign in to comment.