aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/logging.hh
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-07-02 09:04:31 -0600
committerBen Burdette <bburdette@gmail.com>2020-07-02 09:04:31 -0600
commitbf2788e4c1d92a8d625f016b2a3b4d34990f33e3 (patch)
treee97552c393a7e0bc4544020869f65486e9f2e8ec /src/libutil/logging.hh
parent5ae498872a832b0df93b551210f0a3a8b6ffaa35 (diff)
move showTrace to new loggerSettings
Diffstat (limited to 'src/libutil/logging.hh')
-rw-r--r--src/libutil/logging.hh16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libutil/logging.hh b/src/libutil/logging.hh
index 273300b50..09619aac6 100644
--- a/src/libutil/logging.hh
+++ b/src/libutil/logging.hh
@@ -2,6 +2,7 @@
#include "types.hh"
#include "error.hh"
+#include "config.hh"
namespace nix {
@@ -34,6 +35,16 @@ typedef enum {
typedef uint64_t ActivityId;
+struct LoggerSettings : Config
+{
+ Setting<bool> showTrace{this,
+ false,
+ "show-trace",
+ "Whether to show a stack trace on evaluation errors."};
+};
+
+extern LoggerSettings loggerSettings;
+
class Logger
{
friend struct Activity;
@@ -75,9 +86,6 @@ public:
logEI(ei);
}
- virtual bool getShowTrace() const = 0;
- virtual void setShowTrace(bool showTrace) = 0;
-
virtual void warn(const std::string & msg);
virtual void startActivity(ActivityId act, Verbosity lvl, ActivityType type,
@@ -149,7 +157,7 @@ struct PushActivity
extern Logger * logger;
-Logger * makeSimpleLogger(bool printBuildLogs = true, bool showTrace = false);
+Logger * makeSimpleLogger(bool printBuildLogs = true);
Logger * makeJSONLogger(Logger & prevLogger);