Skip to content

Commit

Permalink
Merge pull request #12133 from momeemt/#11991-logs_ignore_empty_lines
Browse files Browse the repository at this point in the history
libmain: fix ignoring empty lines in the print-build-logs option
  • Loading branch information
mergify[bot] authored Jan 18, 2025
2 parents 4f0e352 + 01c96f9 commit bcb92a5
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/libmain/progress-bar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,23 +287,21 @@ class ProgressBar : public Logger

else if (type == resBuildLogLine || type == resPostBuildLogLine) {
auto lastLine = chomp(getS(fields, 0));
if (!lastLine.empty()) {
auto i = state->its.find(act);
assert(i != state->its.end());
ActInfo info = *i->second;
if (printBuildLogs) {
auto suffix = "> ";
if (type == resPostBuildLogLine) {
suffix = " (post)> ";
}
log(*state, lvlInfo, ANSI_FAINT + info.name.value_or("unnamed") + suffix + ANSI_NORMAL + lastLine);
} else {
state->activities.erase(i->second);
info.lastLine = lastLine;
state->activities.emplace_back(info);
i->second = std::prev(state->activities.end());
update(*state);
auto i = state->its.find(act);
assert(i != state->its.end());
ActInfo info = *i->second;
if (printBuildLogs) {
auto suffix = "> ";
if (type == resPostBuildLogLine) {
suffix = " (post)> ";
}
log(*state, lvlInfo, ANSI_FAINT + info.name.value_or("unnamed") + suffix + ANSI_NORMAL + lastLine);
} else {
state->activities.erase(i->second);
info.lastLine = lastLine;
state->activities.emplace_back(info);
i->second = std::prev(state->activities.end());
update(*state);
}
}

Expand Down

0 comments on commit bcb92a5

Please sign in to comment.