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.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 105fadb15..832aee783 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -1,5 +1,6 @@
#include "logging.hh"
#include "util.hh"
+#include "config.hh"
#include <atomic>
#include <nlohmann/json.hpp>
@@ -7,6 +8,10 @@
namespace nix {
+LoggerSettings loggerSettings;
+
+static GlobalConfig::Register r1(&loggerSettings);
+
static thread_local ActivityId curActivity = 0;
ActivityId getCurActivity()
@@ -72,7 +77,7 @@ public:
void logEI(const ErrorInfo & ei) override
{
std::stringstream oss;
- oss << ei;
+ showErrorInfo(oss, ei, loggerSettings.showTrace.get());
log(ei.level, oss.str());
}
@@ -173,7 +178,7 @@ struct JSONLogger : Logger {
void logEI(const ErrorInfo & ei) override
{
std::ostringstream oss;
- oss << ei;
+ showErrorInfo(oss, ei, loggerSettings.showTrace.get());
nlohmann::json json;
json["action"] = "msg";