diff options
Diffstat (limited to 'project2/common/consoleLog.cpp')
-rw-r--r-- | project2/common/consoleLog.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/project2/common/consoleLog.cpp b/project2/common/consoleLog.cpp index 9c5c2d8..de45245 100644 --- a/project2/common/consoleLog.cpp +++ b/project2/common/consoleLog.cpp @@ -1,10 +1,10 @@ #include "logger.h" +#include "options.h" /// Logger that writes to the console class ConsoleLogDriver : public LogDriverBase { public: - ConsoleLogDriver(int level, const std::string &) : - LogDriverBase(level) + ConsoleLogDriver() { } void message(int priority, const char * msg) const @@ -14,7 +14,16 @@ class ConsoleLogDriver : public LogDriverBase { fflush(stderr); } } + INITOPTIONS; + static int level; }; -DECLARE_GENERIC_LOADER("console", LogDriverLoader, ConsoleLogDriver); +DECLARE_OPTIONS(ConsoleLogDriver, "Console log options") +("common.consolelogLevel", Options::value(&level, LOG_WARNING), + "Log to console with level <arg> (default WARNING)")("c") +END_OPTIONS(ConsoleLogDriver); + +int ConsoleLogDriver::level; + +DECLARE_LOGGER_LOADER("console", ConsoleLogDriver); |