]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2445] Remove setLogLevel(TRACE) in createBufferAppender
authorJelte Jansen <jelte@isc.org>
Mon, 10 Dec 2012 23:37:04 +0000 (00:37 +0100)
committerJelte Jansen <jelte@isc.org>
Mon, 10 Dec 2012 23:37:04 +0000 (00:37 +0100)
This has a chance that some log messages get lost (DEBUG messages during startup in case -v is not given but the config has DEBUG set)

src/lib/log/logger_manager_impl.cc
src/lib/log/tests/buffer_logger_test.cc

index 6862d0cb51c928fd1d752b7caa50c5946462e814..3d12571cf3be2c23e62f7b05b41973f823050309 100644 (file)
@@ -145,9 +145,6 @@ LoggerManagerImpl::createBufferAppender(log4cplus::Logger& logger) {
     log4cplus::SharedAppenderPtr bufferapp(new internal::BufferAppender());
     bufferapp->setName("buffer");
     logger.addAppender(bufferapp);
-    // Since we do not know at what level the loggers will end up
-    // running, set it to the highest for now
-    logger.setLogLevel(log4cplus::TRACE_LOG_LEVEL);
 }
 
 // Syslog appender.
index 8d1b3cf519ade27c8b2d127df12dbab4284bd719..84fb7973f8dfc8772568c1544405d116e50dab8b 100644 (file)
@@ -22,7 +22,7 @@ using namespace isc::log;
 
 namespace {
 void usage() {
-    std::cout << "Usage: buffer_logger_test [-n]" << std::endl;
+    std::cout << "Usage: buffer_logger_test [-nv]" << std::endl;
 }
 } // end unnamed namespace
 
@@ -52,10 +52,10 @@ main(int argc, char** argv) {
         }
     }
 
-    // Note, level is INFO, so DEBUG should normally not show
-    // up. Unless process is never called (at which point it
-    // will end up in the dump at the end).
-    initLogger("buffertest", isc::log::INFO, 0, NULL, true);
+    // Note, level is set to DEBUG here, but back to INFO
+    // in process(), so when flushing to stdout (-n), the DEBUG
+    // message should show up
+    initLogger("buffertest", isc::log::DEBUG, 99, NULL, true);
     Logger logger("log");
     // No need for file interprocess locking in this test
     logger.setInterprocessSync(new isc::util::InterprocessSyncNull("logger"));