summaryrefslogtreecommitdiff
path: root/src/lib/log.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-21 16:44:06 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-21 16:44:06 +0100
commit71d8cf20889a3c419c9a3e485f461236e5317423 (patch)
treefb2108412c8a172b423cfe48b15a5f31617eade3 /src/lib/log.h
parentd2fef4faff679d564a72543c858c4bfb62f85791 (diff)
Tidy up logging a bit. Make it configurable from the GUI.
Diffstat (limited to 'src/lib/log.h')
-rw-r--r--src/lib/log.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/log.h b/src/lib/log.h
index 991532404..641ce186d 100644
--- a/src/lib/log.h
+++ b/src/lib/log.h
@@ -37,17 +37,16 @@ public:
Log ();
virtual ~Log () {}
- enum Level {
- STANDARD = 0,
- VERBOSE = 1,
- TIMING = 2
- };
+ static const int GENERAL;
+ static const int WARNING;
+ static const int ERROR;
+ static const int TIMING;
- void log (std::string m, Level l = STANDARD);
- void microsecond_log (std::string m, Level l = STANDARD);
+ void log (std::string message, int type);
+ void microsecond_log (std::string message, int type);
- void set_level (Level l);
- void set_level (std::string l);
+ void set_types (int types);
+ void set_types (std::string types);
protected:
/** mutex to protect the log */
@@ -55,9 +54,10 @@ protected:
private:
virtual void do_log (std::string m) = 0;
+ void config_changed ();
- /** level above which to ignore log messages */
- Level _level;
+ /** bit-field of log types which should be put into the log (others are ignored) */
+ int _types;
};
class FileLog : public Log