diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-10-24T12·47+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-10-24T12·47+0200 |
commit | 96051dd057d46d5953b2fbe3de67269d175306dc (patch) | |
tree | 832bdd7bdbd63fee747838d35a014b9f9451d811 /src/libutil | |
parent | be220702a75427b80258a92d1ed8c4573c1478fa (diff) |
More progress indicator improvements
Fixes #1599.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/logging.cc | 4 | ||||
-rw-r--r-- | src/libutil/logging.hh | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 1a2684a43a5e..011155871122 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -176,7 +176,7 @@ static Logger::Fields getFields(nlohmann::json & json) } bool handleJSONLogMessage(const std::string & msg, - const Activity & act, std::map<ActivityId, Activity> & activities) + const Activity & act, std::map<ActivityId, Activity> & activities, bool trusted) { if (!hasPrefix(msg, "@nix ")) return false; @@ -187,7 +187,7 @@ bool handleJSONLogMessage(const std::string & msg, if (action == "start") { auto type = (ActivityType) json["type"]; - if (type == actDownload || type == actUnknown) + if (trusted || type == actDownload) activities.emplace(std::piecewise_construct, std::forward_as_tuple(json["id"]), std::forward_as_tuple(*logger, (Verbosity) json["level"], type, diff --git a/src/libutil/logging.hh b/src/libutil/logging.hh index 70a9f5d86249..677aa4daec4d 100644 --- a/src/libutil/logging.hh +++ b/src/libutil/logging.hh @@ -133,7 +133,8 @@ Logger * makeDefaultLogger(); Logger * makeJSONLogger(Logger & prevLogger); bool handleJSONLogMessage(const std::string & msg, - const Activity & act, std::map<ActivityId, Activity> & activities); + const Activity & act, std::map<ActivityId, Activity> & activities, + bool trusted); extern Verbosity verbosity; /* suppress msgs > this */ |