Skip to content

Commit

Permalink
logging: handle build log lines in simple logger
Browse files Browse the repository at this point in the history
The raw stderr output isn't logged anymore so the build logs need to be
printed by the default logger in order for the old commands like
nix-build to still show build output.
  • Loading branch information
LnL7 committed May 2, 2020
1 parent cd8d371 commit 7bcd39d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libutil/logging.cc
Expand Up @@ -63,6 +63,16 @@ class SimpleLogger : public Logger
writeToStderr(prefix + filterANSIEscapes(fs.s, !tty) + "\n");
}

void result(ActivityId act, ResultType type, const std::vector<Field> & fields) override
{
if (type == resBuildLogLine || type == resPostBuildLogLine) {
assert(0 < fields.size());
assert(fields[0].type == Logger::Field::tString);
auto lastLine = fields[0].s;
log(lvlInfo, lastLine);
}
}

void startActivity(ActivityId act, Verbosity lvl, ActivityType type,
const std::string & s, const Fields & fields, ActivityId parent)
override
Expand Down

0 comments on commit 7bcd39d

Please sign in to comment.