logging: handle build log lines in simple logger

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.
This commit is contained in:
Daiderd Jordan 2020-05-02 23:26:12 +02:00
parent f16e24f95e
commit 4769eea5e2
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -63,6 +63,16 @@ public:
writeToStderr(prefix + filterANSIEscapes(fs.s, !tty) + "\n"); 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, void startActivity(ActivityId act, Verbosity lvl, ActivityType type,
const std::string & s, const Fields & fields, ActivityId parent) const std::string & s, const Fields & fields, ActivityId parent)
override override