Browse Source

[trac1008] Address review comments

Stephen Morris 14 years ago
parent
commit
f9a545ca4c
2 changed files with 7 additions and 13 deletions
  1. 1 1
      src/lib/log/logger.h
  2. 6 12
      src/lib/log/logger_support.cc

+ 1 - 1
src/lib/log/logger.h

@@ -243,7 +243,7 @@ private:
     /// before the underlying logging system is initialized.  However, any
     /// attempt to access a logging method on any logger before initialization -
     /// regardless of whether is is statically or automatically declared -  will
-    /// cause an exception to be thrown.
+    /// cause a "LoggingNotInitialized" exception to be thrown.
     ///
     /// \return Returns pointer to implementation
     LoggerImpl* getLoggerPtr() {

+ 6 - 12
src/lib/log/logger_support.cc

@@ -37,14 +37,8 @@ using namespace std;
 
 namespace {
 
-// Flag to hold logging initialization state.  This is held inside a function
-// to ensure that it is correctly initialized even when referenced during
-// program initialization (thus avoiding the "static initialization fiasco").
-bool&
-loggingInitializationFlag() {
-    static bool init_flag = false;
-    return (init_flag);
-}
+// Flag to hold logging initialization state.
+bool logging_init_state = false;
 
 } // Anonymous namespace
 
@@ -54,7 +48,7 @@ namespace log {
 // Return initialization state.
 bool
 isLoggingInitialized() {
-    return (loggingInitializationFlag());
+    return (logging_init_state);
 }
 
 // Set initialization state.  (Note: as logging can be initialized via a direct
@@ -62,11 +56,11 @@ isLoggingInitialized() {
 // the initialization functions in this file.
 void
 setLoggingInitialized(bool state) {
-    loggingInitializationFlag() = state;
+    logging_init_state = state;
 }
 
-// Logger Run-Time Initialization.  This function is present for historical
-// reasons.
+// Logger Run-Time Initialization.
+
 void
 initLogger(const string& root, isc::log::Severity severity, int dbglevel,
     const char* file) {