Add option to redirect logging to stderr. (resolves #154)

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-09-23 02:15:05 +00:00
parent 89a67af607
commit 5467c9e486
3 changed files with 18 additions and 2 deletions

View File

@@ -28,13 +28,13 @@ pub struct ConsoleWriter {
impl ConsoleWriter {
#[must_use]
pub fn new(_config: &Config) -> Self {
pub fn new(config: &Config) -> Self {
let journal_stream = get_journal_stream();
Self {
stdout: io::stdout(),
stderr: io::stderr(),
_journal_stream: journal_stream.into(),
use_stderr: journal_stream.0 != 0,
use_stderr: journal_stream.0 != 0 || config.log_to_stderr,
}
}
}