Skip to content

Commit bcb92a5

Browse files
authored
Merge pull request #12133 from momeemt/#11991-logs_ignore_empty_lines
libmain: fix ignoring empty lines in the print-build-logs option
2 parents 4f0e352 + 01c96f9 commit bcb92a5

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/libmain/progress-bar.cc

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -287,23 +287,21 @@ class ProgressBar : public Logger
287287

288288
else if (type == resBuildLogLine || type == resPostBuildLogLine) {
289289
auto lastLine = chomp(getS(fields, 0));
290-
if (!lastLine.empty()) {
291-
auto i = state->its.find(act);
292-
assert(i != state->its.end());
293-
ActInfo info = *i->second;
294-
if (printBuildLogs) {
295-
auto suffix = "> ";
296-
if (type == resPostBuildLogLine) {
297-
suffix = " (post)> ";
298-
}
299-
log(*state, lvlInfo, ANSI_FAINT + info.name.value_or("unnamed") + suffix + ANSI_NORMAL + lastLine);
300-
} else {
301-
state->activities.erase(i->second);
302-
info.lastLine = lastLine;
303-
state->activities.emplace_back(info);
304-
i->second = std::prev(state->activities.end());
305-
update(*state);
290+
auto i = state->its.find(act);
291+
assert(i != state->its.end());
292+
ActInfo info = *i->second;
293+
if (printBuildLogs) {
294+
auto suffix = "> ";
295+
if (type == resPostBuildLogLine) {
296+
suffix = " (post)> ";
306297
}
298+
log(*state, lvlInfo, ANSI_FAINT + info.name.value_or("unnamed") + suffix + ANSI_NORMAL + lastLine);
299+
} else {
300+
state->activities.erase(i->second);
301+
info.lastLine = lastLine;
302+
state->activities.emplace_back(info);
303+
i->second = std::prev(state->activities.end());
304+
update(*state);
307305
}
308306
}
309307

0 commit comments

Comments
 (0)