forge
Explore
Log in

Don't you dare go Hollow

main: Log to stderr instead of stdout

Browse files at this commit

e88dfae46fed95a2b302e1d1e805da10c2b95fa1Jon HeinritzParent: f95d5a8
Currently we can't use logging in paths like niri msg that have meaningful
stdout. Logging to stderr makes that possible. Even if we don't want to log
anything in niri msg code paths, it's easy to have something accidentally log.
src/main.rsmodified+1 -0
@@ -52,6 +52,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
52 let env_filter = EnvFilter::builder().parse_lossy(directives);52 let env_filter = EnvFilter::builder().parse_lossy(directives);
53 tracing_subscriber::fmt()53 tracing_subscriber::fmt()
54 .compact()54 .compact()
55+ .with_writer(io::stderr)
55 .with_env_filter(env_filter)56 .with_env_filter(env_filter)
56 .init();57 .init();
57 58