Module: check_mk
Branch: master
Commit: 3b93e0ef219e5b987d26546914d37ae8f22f5aa4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3b93e0ef219e5b…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Sep 5 16:39:33 2016 +0200
Fetched Livestatus from downstream.
---
livestatus/src/Logger.cc | 13 ++++---------
livestatus/src/Logger.h | 4 ++++
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/livestatus/src/Logger.cc b/livestatus/src/Logger.cc
index 6bdbb2c..071e4d3 100644
--- a/livestatus/src/Logger.cc
+++ b/livestatus/src/Logger.cc
@@ -81,31 +81,26 @@ LogLevel Logger::getLevel() {
return _level;
}
-#ifndef CMC
-// cppcheck-suppress unusedFunction
-#endif
+#ifdef CMC
void Logger::setLevel(LogLevel level) {
lock_guard<mutex> lg(_mutex);
_level = level;
}
-#ifndef CMC
-// cppcheck-suppress unusedFunction
-#endif
Handler *Logger::getHandler() {
lock_guard<mutex> lg(_mutex);
return _handler.get();
}
+#endif
void Logger::setHandler(std::unique_ptr<Handler> handler) {
lock_guard<mutex> lg(_mutex);
_handler = std::move(handler);
}
-#ifndef CMC
-// cppcheck-suppress unusedFunction
-#endif
+#ifdef CMC
bool Logger::isLoggable(LogLevel level) { return level <= getLevel(); }
+#endif
void Logger::log(const LogRecord &record) {
lock_guard<mutex> lg(_mutex);
diff --git a/livestatus/src/Logger.h b/livestatus/src/Logger.h
index 5f334f5..b836657 100644
--- a/livestatus/src/Logger.h
+++ b/livestatus/src/Logger.h
@@ -127,12 +127,16 @@ public:
static Logger *getLogger() { return &_global_logger; }
LogLevel getLevel();
+#ifdef CMC
void setLevel(LogLevel level);
Handler *getHandler();
+#endif
void setHandler(std::unique_ptr<Handler> handler);
+#ifdef CMC
bool isLoggable(LogLevel level);
+#endif
void log(const LogRecord &record);
private: