Watch
0
0
Fork
You've already forked hyperhive
0

hive-c0re, hive-priv: demote three routine, non-actionable log sites

This commit is contained in:
damocles 2026-10-07 23:50:36 +02:00 • committed by mara
commit 25893d0f95
3 changed files with 46 additions and 3 deletions

View file

@ -806,7 +806,11 @@ pub async fn prebuild_toplevel(name: &str, flake_ref: &str, node_id: Option<u64>
let pump_stderr = tokio::spawn(async move {
let mut lines = BufReader::new(stderr).lines();
while let Ok(Some(line)) = lines.next_line().await {
tracing::warn!(target: "nix-prebuild", cmdline = %stderr_cmdline, "{line}");
if is_real_nix_warning(&line) {
tracing::warn!(target: "nix-prebuild", cmdline = %stderr_cmdline, "{line}");
} else {
tracing::info!(target: "nix-prebuild", cmdline = %stderr_cmdline, "{line}");
}
if let (Some(h), Some(id)) = (&stderr_logs, log_id) {
h.append_stderr(id, &line);
}
@ -889,6 +893,15 @@ pub fn ensure_agent_runtime_dir(name: &str) -> Result<()> {
.with_context(|| format!("create agent runtime dir {}", dir.display()))
}
/// Whether a `nix`/`nixos-container` stderr line is an actual warning
/// (nix's own convention: a genuine warning starts with `warning:`) rather
/// than routine progress chatter (`copying N paths…`, `fetching git
/// input…`, `structuredAttrs is enabled`, …) — nix writes the latter to
/// stderr too, and it dwarfs the former in volume.
fn is_real_nix_warning(line: &str) -> bool {
line.trim_start().starts_with("warning:")
}
/// Build the per-line callback for `create_container_streaming` /
/// `update_container_streaming`. Both ops share identical dispatch logic
/// (stdout → info + `append_stdout`, stderr → warn + `append_stderr`); this
@ -907,7 +920,11 @@ fn make_log_callback(
}
}
PrivStream::Stderr => {
tracing::warn!(target: "nixos-container", cmdline = %cmdline, "{line}");
if is_real_nix_warning(line) {
tracing::warn!(target: "nixos-container", cmdline = %cmdline, "{line}");
} else {
tracing::info!(target: "nixos-container", cmdline = %cmdline, "{line}");
}
if let (Some(h), Some(id)) = (&logs, log_id) {
h.append_stderr(id, line);
}