rbatis / fast_log

Rust async log High-performance asynchronous logging
Apache License 2.0
251 stars 13 forks source link

console appender uses stdout instead of stderr #33

Open Jajcus opened 6 months ago

Jajcus commented 6 months ago

I have been using fast_log crate for my logging, as it happened to be used in an example code I started with. Was good enough for me until my code had to generate some output on stdout. Unexpectedly the logging messages got mixed with the output.

Expected behaviour: 'console' logging goes to stderr, regular program output (including println!() or explicit writes to stdout) go to stdout, so consumers can differentiate those.

Actual behaviour: console logging goes to stdout, where the actual program output belongs.

Note: changing this now could be a breaking change for anyone who relies on current (broken) behaviour, e.g. when calling binaries built with this crate in a shell scripts and parsing its logging output.

zhuxiujia commented 4 months ago

I have been using fast_log crate for my logging, as it happened to be used in an example code I started with. Was good enough for me until my code had to generate some output on stdout. Unexpectedly the logging messages got mixed with the output.

Expected behaviour: 'console' logging goes to stderr, regular program output (including println!() or explicit writes to stdout) go to stdout, so consumers can differentiate those.

Actual behaviour: console logging goes to stdout, where the actual program output belongs.

Note: changing this now could be a breaking change for anyone who relies on current (broken) behaviour, e.g. when calling binaries built with this crate in a shell scripts and parsing its logging output.

did you try use custom_appender ?