fix(#2676): stop hive-priv flooding the journal with list output
`container_run` logs every stdout line at INFO (target `nixos-container`) as operation progress. For the read-only `list` op — called on the hot path (dashboard rescan, forge + boot sweeps) — that stdout is the return value, not progress, so every call logs the full ~28-line container roster at INFO. hive-c0re calls it several times a second, flooding the host journal. Gate the stdout per-line INFO logging on the op not being `list`. Mutating ops still log their progress; stderr is still logged for every op (errors matter regardless). No behaviour change beyond log volume.
This commit is contained in:
parent
a66b7ab298
commit
9f82dc4e7d
1 changed files with 9 additions and 2 deletions
|
|
@ -1419,8 +1419,15 @@ async fn container_run(args: &[&str]) -> Result<(String, String)> {
|
|||
.context("invoke nixos-container")?;
|
||||
let stdout = String::from_utf8_lossy(&out.stdout).into_owned();
|
||||
let stderr = String::from_utf8_lossy(&out.stderr).into_owned();
|
||||
for line in stdout.lines() {
|
||||
tracing::info!(target: "nixos-container", "{line}");
|
||||
// `list` is a read-only enumeration called on the hot path (dashboard
|
||||
// rescan, forge + boot sweeps) — its stdout is the return value, not
|
||||
// progress, so logging every container name on every call floods the
|
||||
// journal. Log stdout only for the mutating ops, where each line is
|
||||
// genuine progress. stderr is always logged (errors matter regardless).
|
||||
if args.first() != Some(&"list") {
|
||||
for line in stdout.lines() {
|
||||
tracing::info!(target: "nixos-container", "{line}");
|
||||
}
|
||||
}
|
||||
for line in stderr.lines() {
|
||||
tracing::warn!(target: "nixos-container", "{line}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue