]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1081] Disable log4cplus internal logging
authorJelte Jansen <jelte@isc.org>
Thu, 20 Dec 2012 14:28:22 +0000 (15:28 +0100)
committerJelte Jansen <jelte@isc.org>
Thu, 20 Dec 2012 14:28:22 +0000 (15:28 +0100)
unless --enable-debug was specified at configure

src/lib/log/logger_manager_impl.cc

index 6862d0cb51c928fd1d752b7caa50c5946462e814..711eae9cc9d70215373e9f7006d01b9cb4063c89 100644 (file)
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <algorithm>
 #include <iostream>
 
@@ -21,6 +23,7 @@
 #include <log4cplus/consoleappender.h>
 #include <log4cplus/fileappender.h>
 #include <log4cplus/syslogappender.h>
+#include <log4cplus/helpers/loglog.h>
 
 #include <log/logger.h>
 #include <log/logger_support.h>
@@ -196,6 +199,13 @@ void LoggerManagerImpl::initRootLogger(isc::log::Severity severity,
 {
     log4cplus::Logger::getDefaultHierarchy().resetConfiguration();
 
+    // Disable log4cplus' own logging, unless --enable-debug was
+    // specified to configure. Note that this does not change
+    // LogLog's levels (that is still just INFO).
+#ifndef ENABLE_DEBUG
+    log4cplus::helpers::LogLog::getLogLog()->setQuietMode(true);
+#endif
+
     // Set the log4cplus root to not output anything - effectively we are
     // ignoring it.
     log4cplus::Logger::getRoot().setLogLevel(log4cplus::OFF_LOG_LEVEL);