Skip to content

Commit

Permalink
devenv: display trace warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Oct 7, 2024
1 parent e168a89 commit 2ebcf20
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion devenv-eval-cache/src/internal_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl InternalLog {
// to filter things out. Our hunch is that these messages are coming from the
// nix daemon.
InternalLog::Msg { msg, level, .. }
if *level == Verbosity::Error && self.is_nix_error() =>
if *level == Verbosity::Error && (self.is_nix_error() || self.is_builtin_trace()) =>
{
Some(msg.clone())
}
Expand Down Expand Up @@ -103,6 +103,22 @@ impl InternalLog {

false
}

/// Check if the log is a trace message from `builtins.trace`.
pub fn is_builtin_trace(&self) -> bool {
if let InternalLog::Msg {
level: Verbosity::Error,
msg,
..
} = self
{
if msg.starts_with("trace:") {
return true;
}
}

false
}
}

/// See https://github.com/NixOS/nix/blob/322d2c767f2a3f8ef2ac3d1ba46c19caf9a1ffce/src/libutil/error.hh#L33-L42
Expand Down

0 comments on commit 2ebcf20

Please sign in to comment.