aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/logging.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r--src/libutil/logging.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 3cc4ef8f1..5cd2524c6 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -22,7 +22,7 @@ Logger * logger = makeDefaultLogger();
void Logger::warn(const std::string & msg)
{
- log(lvlWarn, ANSI_YELLOW "warning:" ANSI_NORMAL " " + msg);
+ log(Verbosity::Warn, ANSI_YELLOW "warning:" ANSI_NORMAL " " + msg);
}
void Logger::writeToStdout(std::string_view s)
@@ -51,10 +51,10 @@ public:
if (systemd) {
char c;
switch (lvl) {
- case lvlError: c = '3'; break;
- case lvlWarn: c = '4'; break;
- case lvlInfo: c = '5'; break;
- case lvlTalkative: case lvlChatty: c = '6'; break;
+ case Verbosity::Error: c = '3'; break;
+ case Verbosity::Warn: c = '4'; break;
+ case Verbosity::Info: c = '5'; break;
+ case Verbosity::Talkative: case Verbosity::Chatty: c = '6'; break;
default: c = '7';
}
prefix = std::string("<") + c + ">";
@@ -72,7 +72,7 @@ public:
}
};
-Verbosity verbosity = lvlInfo;
+Verbosity verbosity = Verbosity::Info;
void warnOnce(bool & haveWarned, const FormatOrString & fs)
{
@@ -129,7 +129,7 @@ struct JSONLogger : Logger
void write(const nlohmann::json & json)
{
- prevLogger.log(lvlError, "@nix " + json.dump());
+ prevLogger.log(Verbosity::Error, "@nix " + json.dump());
}
void log(Verbosity lvl, const FormatOrString & fs) override
@@ -204,7 +204,7 @@ bool handleJSONLogMessage(const std::string & msg,
if (action == "start") {
auto type = (ActivityType) json["type"];
- if (trusted || type == actFileTransfer)
+ if (trusted || type == ActivityType::Download)
activities.emplace(std::piecewise_construct,
std::forward_as_tuple(json["id"]),
std::forward_as_tuple(*logger, (Verbosity) json["level"], type,
@@ -222,7 +222,7 @@ bool handleJSONLogMessage(const std::string & msg,
else if (action == "setPhase") {
std::string phase = json["phase"];
- act.result(resSetPhase, phase);
+ act.result(ResultType::SetPhase, phase);
}
else if (action == "msg") {