mirror of
https://github.com/NixOS/nix
synced 2025-06-29 02:11:15 +02:00
Merge pull request #3073 from tweag/machine-logs
Add an option to print the logs in a machine-readable format
This commit is contained in:
commit
ac4d43a31b
19 changed files with 187 additions and 31 deletions
|
@ -1642,7 +1642,7 @@ void DerivationGoal::buildDone()
|
|||
worker.store.printStorePath(drvPath),
|
||||
statusToString(status));
|
||||
|
||||
if (!settings.verboseBuild && !logTail.empty()) {
|
||||
if (!logger->isVerbose() && !logTail.empty()) {
|
||||
msg += (format("; last %d log lines:") % logTail.size()).str();
|
||||
for (auto & line : logTail)
|
||||
msg += "\n " + line;
|
||||
|
@ -1691,11 +1691,7 @@ void DerivationGoal::buildDone()
|
|||
}
|
||||
|
||||
void flushLine() {
|
||||
if (settings.verboseBuild) {
|
||||
printError("post-build-hook: " + currentLine);
|
||||
} else {
|
||||
act.result(resPostBuildLogLine, currentLine);
|
||||
}
|
||||
act.result(resPostBuildLogLine, currentLine);
|
||||
currentLine.clear();
|
||||
}
|
||||
|
||||
|
@ -4155,13 +4151,8 @@ void DerivationGoal::flushLine()
|
|||
;
|
||||
|
||||
else {
|
||||
if (settings.verboseBuild &&
|
||||
(settings.printRepeatedBuilds || curRound == 1))
|
||||
printError(currentLogLine);
|
||||
else {
|
||||
logTail.push_back(currentLogLine);
|
||||
if (logTail.size() > settings.logLines) logTail.pop_front();
|
||||
}
|
||||
logTail.push_back(currentLogLine);
|
||||
if (logTail.size() > settings.logLines) logTail.pop_front();
|
||||
|
||||
act->result(resBuildLogLine, currentLogLine);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue