diff options
author | Ben Burdette <bburdette@gmail.com> | 2020-05-11 14:35:30 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2020-05-11 14:35:30 -0600 |
commit | 59b1f5c70150a81c7a6fa0dc3309a9d44e9621f8 (patch) | |
tree | 542fc01dfaffdf7acbc5c1a89fd41a0918396f4b /src/libutil/logging.cc | |
parent | 536bbf53e12c80f52c2679aec734d895b0058f5b (diff) | |
parent | 5bdb67c84308a8cc78ac633d27b94eca87ea4390 (diff) |
Merge branch 'master' into errors-phase-2
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r-- | src/libutil/logging.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 4244d1221..7c75456ee 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -3,7 +3,7 @@ #include <atomic> #include <nlohmann/json.hpp> -#include <sstream> +#include <iostream> namespace nix { @@ -25,6 +25,11 @@ void Logger::warn(const std::string & msg) log(lvlWarn, ANSI_YELLOW "warning:" ANSI_NORMAL " " + msg); } +void Logger::writeToStdout(std::string_view s) +{ + std::cout << s << "\n"; +} + class SimpleLogger : public Logger { public: @@ -243,7 +248,7 @@ bool handleJSONLogMessage(const std::string & msg, if (action == "start") { auto type = (ActivityType) json["type"]; - if (trusted || type == actDownload) + if (trusted || type == actFileTransfer) activities.emplace(std::piecewise_construct, std::forward_as_tuple(json["id"]), std::forward_as_tuple(*logger, (Verbosity) json["level"], type, |