diff options
author | Daiderd Jordan <daiderd@gmail.com> | 2020-05-02 23:26:12 +0200 |
---|---|---|
committer | Daiderd Jordan <daiderd@gmail.com> | 2020-05-02 23:40:53 +0200 |
commit | 4769eea5e2229c01c3b5d050891b071a45a024d5 (patch) | |
tree | 391e9ba28260f2db7ebe31aa6d3ad7a6c72d7e2e /src | |
parent | f16e24f95e7d7fa3a5c3b2c8d43d171fa5b9cf85 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/logging.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 3cc4ef8f1..777650de5 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -63,6 +63,16 @@ public: 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 |