1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

move showTrace to new loggerSettings

This commit is contained in:
Ben Burdette 2020-07-02 09:04:31 -06:00
parent 5ae498872a
commit bf2788e4c1
10 changed files with 35 additions and 57 deletions

View file

@ -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);