]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3591] Logging::applyDefaultConfiguration() removed.
authorTomek Mrugalski <tomasz@isc.org>
Tue, 23 Sep 2014 12:41:43 +0000 (14:41 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 23 Sep 2014 12:41:43 +0000 (14:41 +0200)
src/lib/dhcpsrv/daemon.cc
src/lib/dhcpsrv/logging.cc
src/lib/dhcpsrv/logging.h

index 6922b276c96fc1217b345f60a0efa5df88ab9193..5169d669d7beef3e083a7c91a2251c4031934a0b 100644 (file)
@@ -61,15 +61,11 @@ void Daemon::configureLogger(const isc::data::ConstElementPtr& log_config,
                              const ConfigurationPtr& storage,
                              bool verbose) {
 
-    // This is utility class that translates JSON structures into formats
-    // understandable by log4cplus.
-    LogConfigParser parser(storage);
-
     if (!log_config) {
         // There was no logger configuration. Let's clear any config
         // and revert to the default.
 
-        parser.applyDefaultConfiguration(verbose); // Set up default logging
+        isc::log::setDefaultLoggingOutput(verbose); // Set up default logging
         return;
     }
 
@@ -80,10 +76,14 @@ void Daemon::configureLogger(const isc::data::ConstElementPtr& log_config,
         // array in it. Let's clear any old logging configuration
         // we may have and revert to the default.
 
-        parser.applyDefaultConfiguration(verbose); // Set up default logging
+        isc::log::setDefaultLoggingOutput(verbose); // Set up default logging
         return;
     }
 
+    // This is utility class that translates JSON structures into formats
+    // understandable by log4cplus.
+    LogConfigParser parser(storage);
+
     // Translate JSON structures into log4cplus formats
     parser.parseConfiguration(loggers, verbose);
 
@@ -101,7 +101,7 @@ void Daemon::loggerInit(const char* name, bool verbose) {
                          NULL);
 
     // Apply default configuration (log INFO or DEBUG to stdout)
-    LogConfigParser::applyDefaultConfiguration(verbose);
+    isc::log::setDefaultLoggingOutput(verbose);
 }
 
 };
index 16a215a960f2d56bc58936eea693f55b2d496ab9..b47b0101b502e07409e9f18bec3fa5d7785896b6 100644 (file)
@@ -213,13 +213,5 @@ void LogConfigParser::applyConfiguration() {
     manager.process(specs.begin(), specs.end());
 }
 
-void LogConfigParser::applyDefaultConfiguration(bool verbose) {
-    LoggerSpecification spec(isc::log::getRootLoggerName(),
-                             (verbose?isc::log::DEBUG : isc::log::INFO),
-                             (verbose?99:0));
-
-    setDefaultLoggingOutput(verbose);
-}
-
 } // namespace isc::dhcp
 } // namespace isc
index 60230f65a2727fe052fe7e2389a71dc515b84267..b92d98056f15c050496de61d3c3520bb3cb1a3ba 100644 (file)
@@ -67,14 +67,6 @@ public:
     /// @brief Applies stored configuration
     void applyConfiguration();
 
-    /// @brief Configures default logging
-    ///
-    /// This method is static, so it can be called in the initial phases of
-    /// the process start-up.
-    ///
-    /// @param verbose specifies verbose mode (true forces DEBUG, debuglevel = 99)
-    static void applyDefaultConfiguration(bool verbose = false);
-
 private:
 
     /// @brief Parses one JSON structure in Logging/loggers" array