1
1
mirror of https://github.com/Nukesor/pueue.git synced 2024-10-04 03:37:33 +03:00

change: Send all log output to stderr

This commit is contained in:
Arne Beer 2024-08-24 14:07:57 +02:00
parent c9279a86af
commit b11eccec5b
No known key found for this signature in database
GPG Key ID: CC9408F679023B65
4 changed files with 27 additions and 5 deletions

View File

@ -43,6 +43,7 @@ TLDR: The new task state representation is more verbose but significantly cleane
**Important: The Pueue daemon needs to be restarted and the state will be wiped clean.**
- **Breaking**: Streamlined `pueue log` parameters to behave the same way as `start`, `pause` or `kill`. [#509](https://github.com/Nukesor/pueue/issues/509)
- **Breaking**: Remove the `--children` commandline flags, that have been deprecated and no longer serve any function since `v3.0.0`.
- **Breaking**: Send log output to `stderr` instead of `stdout` [#562](https://github.com/Nukesor/pueue/issues/562).
### Add
@ -59,6 +60,7 @@ TLDR: The new task state representation is more verbose but significantly cleane
- Fixed delay after sending process related commands from client. [#548](https://github.com/Nukesor/pueue/pull/548)
- Callback templating arguments were html escaped by accident. [#564](https://github.com/Nukesor/pueue/pull/564)
- Print incompatible version warning info as a log message instead of plain stdout input, which broke json outputs [#562](https://github.com/Nukesor/pueue/issues/562).
## \[3.4.1\] - 2024-06-04

View File

@ -4,7 +4,7 @@ use anyhow::{bail, Context, Result};
use clap::{CommandFactory, Parser};
use clap_complete::{generate, generate_to, shells};
use log::warn;
use simplelog::{Config, ConfigBuilder, LevelFilter, SimpleLogger};
use simplelog::{Config, ConfigBuilder, LevelFilter, SimpleLogger, TermLogger, TerminalMode};
use pueue_lib::settings::Settings;
@ -51,7 +51,17 @@ async fn main() -> Result<()> {
Ok(builder) => builder.build(),
};
SimpleLogger::init(level, logger_config).unwrap();
// Init a terminal logger. If this fails for some reason, try fallback to a SimpleLogger
if TermLogger::init(
level,
logger_config.clone(),
TerminalMode::Stderr,
simplelog::ColorChoice::Auto,
)
.is_err()
{
SimpleLogger::init(level, logger_config).unwrap();
}
// Try to read settings from the configuration file.
let (mut settings, config_found) =

View File

@ -3,7 +3,7 @@ use std::process::Command;
use anyhow::Result;
use clap::Parser;
use log::warn;
use simplelog::{Config, ConfigBuilder, LevelFilter, SimpleLogger};
use simplelog::{Config, ConfigBuilder, LevelFilter, SimpleLogger, TermLogger, TerminalMode};
use pueue::daemon::cli::CliArguments;
use pueue::daemon::run;
@ -35,7 +35,17 @@ async fn main() -> Result<()> {
Ok(builder) => builder.build(),
};
SimpleLogger::init(level, logger_config).unwrap();
// Init a terminal logger. If this fails for some reason, try fallback to a SimpleLogger
if TermLogger::init(
level,
logger_config.clone(),
TerminalMode::Stderr,
simplelog::ColorChoice::Auto,
)
.is_err()
{
SimpleLogger::init(level, logger_config).unwrap();
}
run(opt.config, opt.profile, false).await
}

View File

@ -110,7 +110,7 @@ impl Client {
};
if show_warning {
println!(
error!(
"Different daemon version detected '{version}'. Consider restarting the daemon."
);
}