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, 18 insertions, 0 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index fa5c84a27..98f500a65 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -3,6 +3,7 @@
#include <atomic>
#include <nlohmann/json.hpp>
+#include <sstream>
namespace nix {
@@ -57,6 +58,14 @@ public:
writeToStderr(prefix + filterANSIEscapes(fs.s, !tty) + "\n");
}
+ void logEI(const ErrorInfo & ei) override
+ {
+ std::stringstream oss;
+ oss << ei;
+
+ log(ei.level, oss.str());
+ }
+
void startActivity(ActivityId act, Verbosity lvl, ActivityType type,
const std::string & s, const Fields & fields, ActivityId parent)
override
@@ -135,6 +144,15 @@ struct JSONLogger : Logger
write(json);
}
+ void logEI(const ErrorInfo & ei) override
+ {
+ // nlohmann::json json;
+ // json["action"] = "msg";
+ // json["level"] = lvl;
+ // json["msg"] = fs.s;
+ // write(json);
+ }
+
void startActivity(ActivityId act, Verbosity lvl, ActivityType type,
const std::string & s, const Fields & fields, ActivityId parent) override
{