Skip to content

Commit

Permalink
log: Never silence log_cmd_error
Browse files Browse the repository at this point in the history
Add extra handling to arrange for `log_cmd_error` never being silenced
by the command line `-v N` option. Similar path for `log_error` exists
already.
  • Loading branch information
povik committed Sep 24, 2024
1 parent 8e1e2b9 commit 3e3515e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions kernel/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,21 @@ void log_cmd_error(const char *format, ...)

if (log_cmd_error_throw) {
log_last_error = vstringf(format, ap);

// Make sure the error message gets through any selective silencing
// of log output
bool pop_errfile = false;
if (log_errfile != NULL) {
log_files.push_back(log_errfile);
pop_errfile = true;
}

log("ERROR: %s", log_last_error.c_str());
log_flush();

if (pop_errfile)
log_files.pop_back();

throw log_cmd_error_exception();
}

Expand Down

0 comments on commit 3e3515e

Please sign in to comment.