[asterisk-scf-commits] asterisk-scf/integration/logger.git branch "filename" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Mar 10 16:19:09 CST 2011


branch "filename" has been created
        at  1ce571cc146ef90318b769d7c712fe51ddc744d6 (commit)

- Log -----------------------------------------------------------------
commit 1ce571cc146ef90318b769d7c712fe51ddc744d6
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Mar 10 16:09:27 2011 -0600

    Add some helpful helpers for some upcoming configuration work.

diff --git a/server/src/FileChainedLogOut.h b/server/src/FileChainedLogOut.h
index abd5c3e..4347a26 100644
--- a/server/src/FileChainedLogOut.h
+++ b/server/src/FileChainedLogOut.h
@@ -48,6 +48,15 @@ public:
      */
     void reopen();
 
+    bool operator ==(const boost::shared_ptr<FileChainedLogOut> &out)
+    {
+        //XXX This isn't foolproof since the same file can be described
+        // using multiple paths. While comparing ofstreams with == compiles,
+        // I cannot find any reference to what the semantics of that operation
+        // are.
+        return mLogFile == out->mLogFile;
+    }
+
 protected:
     void myLogs(const std::string& name, Level logLevel,
         const std::string& message);
diff --git a/server/src/LoggingServer.cpp b/server/src/LoggingServer.cpp
index edd36b3..0b4d642 100644
--- a/server/src/LoggingServer.cpp
+++ b/server/src/LoggingServer.cpp
@@ -81,9 +81,13 @@ void LoggingServerI::logs(const std::string& name, Level level,
 {
     if (isEnabledFor(name, level))
     {
-        if (mOut.get())
+        if (!mLogsOut.empty())
         {
-            mOut->logs(name, level, message);
+            for (std::vector<boost::shared_ptr<ChainedLogOut> >::const_iterator i = mLogsOut.begin();
+                    i != mLogsOut.end(); ++ i)
+            {
+                (*i)->logs(name, level, message);
+            }
         }
         else
         {
@@ -142,7 +146,7 @@ void LoggingServerI::configure(const boost::shared_ptr<ChainedLogOut>& out,
     const ServerConfigurationListenerPrx& configurationListener,
     const Ice::PropertiesPtr& props)
 {
-    this->mOut = out;
+    mLogsOut.push_back(out);
     this->mConfigurationListener = configurationListener;
 
     Ice::PropertyDict myProps = props->getPropertiesForPrefix(
@@ -166,3 +170,21 @@ void LoggingServerI::configure(const boost::shared_ptr<ChainedLogOut>& out,
         }
     }
 }
+
+void LoggingServerI::removeLogOut(const boost::shared_ptr<ChainedLogOut> &out)
+{
+    mLogsOut.erase(std::remove(mLogsOut.begin(), mLogsOut.end(), out));
+}
+
+void LoggingServerI::addLogOut(const boost::shared_ptr<ChainedLogOut> &out)
+{
+    if (std::find(mLogsOut.begin(), mLogsOut.end(), out) == mLogsOut.end())
+    {
+        mLogsOut.push_back(out);
+    }
+}
+
+void LoggingServerI::clearLogsOut()
+{
+    mLogsOut.clear();
+}
diff --git a/server/src/LoggingServer.h b/server/src/LoggingServer.h
index a557a05..9adce20 100644
--- a/server/src/LoggingServer.h
+++ b/server/src/LoggingServer.h
@@ -78,6 +78,11 @@ public:
 
     ASTERISK_SCF_ICEBOX_EXPORT void configure(const boost::shared_ptr<ChainedLogOut>& out, const ServerConfigurationListenerPrx& configurationListener, const Ice::PropertiesPtr& props);
 
+    void replaceLogOut(const boost::shared_ptr<ChainedLogOut> &out);
+    void removeLogOut(const boost::shared_ptr<ChainedLogOut> &out);
+    void addLogOut(const boost::shared_ptr<ChainedLogOut> &out);
+    void clearLogsOut();
+
     static const std::string LoggingPropertyPrefix;
 
 private:
@@ -99,7 +104,7 @@ private:
 
     ServerConfigurationListenerPrx mConfigurationListener;
 
-    boost::shared_ptr<ChainedLogOut> mOut;
+    std::vector<boost::shared_ptr<ChainedLogOut> > mLogsOut;
 };
 
 } // Logging
diff --git a/server/src/OstreamChainedLogOut.h b/server/src/OstreamChainedLogOut.h
index 1537807..882245d 100644
--- a/server/src/OstreamChainedLogOut.h
+++ b/server/src/OstreamChainedLogOut.h
@@ -41,6 +41,11 @@ public:
     {
     }
 
+    bool operator ==(const boost::shared_ptr<OstreamChainedLogOut> &out)
+    {
+        return mOut == out->mOut;
+    }
+
 protected:
     void myLogs(const std::string& name, Level logLevel,
         const std::string& message);

commit 81ea1d5f5b6668733c15da3a30dd128d5295faac
Author: David M. Lee <dlee at digium.com>
Date:   Mon Feb 21 09:35:42 2011 -0600

    Fixed for new ClassMemberDefault slice translator plugin.

diff --git a/client/test/IceConfigurator-test.cpp b/client/test/IceConfigurator-test.cpp
index 0ec8fef..5c07dd4 100644
--- a/client/test/IceConfigurator-test.cpp
+++ b/client/test/IceConfigurator-test.cpp
@@ -26,9 +26,7 @@ namespace
 {
 void addConfig(Configuration& cfg, const std::string& name, Level logLevel)
 {
-    SourceConfiguration sourceConfig = {};
-    sourceConfig.name = name;
-    sourceConfig.logLevel = logLevel;
+    SourceConfiguration sourceConfig(name, logLevel);
 
     cfg.sourceSettings.push_back(sourceConfig);
 }
diff --git a/server/src/LoggingServer.cpp b/server/src/LoggingServer.cpp
index 43428aa..edd36b3 100644
--- a/server/src/LoggingServer.cpp
+++ b/server/src/LoggingServer.cpp
@@ -105,10 +105,7 @@ Configuration LoggingServerI::getConfiguration() const
     for (Sources::const_reverse_iterator i = mSources.rbegin(); i
              != mSources.rend(); ++i)
     {
-        SourceConfiguration v =
-            { };
-        v.name = i->first;
-        v.logLevel = i->second.getLogLevel();
+        SourceConfiguration v(i->first, i->second.getLogLevel());
         r.sourceSettings.push_back(v);
     }
     return r;

commit 44eae42bc428ca2b83487e611f31c79260d1b322
Author: David M. Lee <dlee at digium.com>
Date:   Thu Jan 20 12:33:26 2011 -0600

    Refactored out several install functions for installation.
    
    * asterisk_scf_component_install - Install a component
    * asterisk_scf_slice_headers_install - Install generated .h files
    * asterisk_scf_slice_install - Install .ice files

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8eb0313..0c055ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,7 +56,5 @@ include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_library(logging-client)
 target_link_libraries(logging-client asterisk-scf-api)
 
-install(TARGETS logging-client
-    LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
-    RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_BIN_DIR})
+asterisk_scf_component_install(logging-client)
 install(DIRECTORY include/ DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR})
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 2946930..e3f1d86 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -43,6 +43,4 @@ asterisk_scf_component_add_file(logging-service main.cpp)
 asterisk_scf_component_build_icebox(logging-service)
 target_link_libraries(logging-service logging-service-lib)
 
-install(TARGETS logging-service
-    LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR}
-    RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
+asterisk_scf_component_install(logging-service)

commit 7abce953fdf0254467e6d73382d3336cbc6c497b
Author: David M. Lee <dlee at digium.com>
Date:   Thu Jan 20 09:01:10 2011 -0600

    Runtime destination for regular libs should be bindir

diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb89de3..8eb0313 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,5 +58,5 @@ target_link_libraries(logging-client asterisk-scf-api)
 
 install(TARGETS logging-client
     LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
-    RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
+    RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_BIN_DIR})
 install(DIRECTORY include/ DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR})

commit 5636b677094cd8d070ba3bf2f4652533523c497f
Author: David M. Lee <dlee at digium.com>
Date:   Mon Jan 17 16:14:07 2011 -0600

    Static logger lib needs to be compiled with -fPIC.

diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 0b33e92..2946930 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -32,6 +32,11 @@ include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_library(logging-service-lib)
 target_link_libraries(logging-service-lib asterisk-scf-api)
 
+# This lib is compiled into a .so, so it needs -fPIC set
+if(CMAKE_COMPILER_IS_GNUCXX)
+    set_target_properties(logging-service-lib PROPERTIES COMPILE_FLAGS -fPIC)
+endif()
+
 # icebox module
 asterisk_scf_component_init(logging-service CXX)
 asterisk_scf_component_add_file(logging-service main.cpp)

commit 483cdca08a0797dbbfe6bd58842ca8aafbbfcd6d
Author: David M. Lee <dlee at digium.com>
Date:   Fri Jan 14 12:59:07 2011 -0600

    Fixed problems caused by linking icebox modules as modules.
    
    On systems where it makes a difference (i.e. Mac OS X), modules cannot
    be used as shared libraries.  Unfortunately, we were loading the logging
    server icebox component as a shared lib in the unit tests.  This patch
    creates a static library which has the bulk of the logic, which is used
    by both the unit tests and the icebox module.

diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 741a2cb..0b33e92 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -6,27 +6,37 @@
 # All rights reserved.
 #
 
-asterisk_scf_component_init(logging-service CXX)
+asterisk_scf_component_init(logging-service-lib CXX)
+
+# an icebox module cannot be used as a shared lib.  so build the bulk of the
+# code as a static lib that can be linked into both the icebox module and
+# the unit tests
+asterisk_scf_set_libtype(logging-service-lib STATIC)
 
 include_directories(../../include)
 
-asterisk_scf_component_add_file(logging-service ChainedLogOut.cpp)
-asterisk_scf_component_add_file(logging-service FileChainedLogOut.cpp)
-asterisk_scf_component_add_file(logging-service LoggingServer.cpp)
-asterisk_scf_component_add_file(logging-service OstreamChainedLogOut.cpp)
-asterisk_scf_component_add_file(logging-service main.cpp)
+asterisk_scf_component_add_file(logging-service-lib ChainedLogOut.cpp)
+asterisk_scf_component_add_file(logging-service-lib FileChainedLogOut.cpp)
+asterisk_scf_component_add_file(logging-service-lib LoggingServer.cpp)
+asterisk_scf_component_add_file(logging-service-lib OstreamChainedLogOut.cpp)
 
-asterisk_scf_component_add_file(logging-service ChainedLogOut.h)
-asterisk_scf_component_add_file(logging-service FileChainedLogOut.h)
-asterisk_scf_component_add_file(logging-service OstreamChainedLogOut.h)
-asterisk_scf_component_add_file(logging-service LoggingServer.h)
+asterisk_scf_component_add_file(logging-service-lib ChainedLogOut.h)
+asterisk_scf_component_add_file(logging-service-lib FileChainedLogOut.h)
+asterisk_scf_component_add_file(logging-service-lib OstreamChainedLogOut.h)
+asterisk_scf_component_add_file(logging-service-lib LoggingServer.h)
 
 asterisk_scf_add_ice_libraries(IceStorm)
-asterisk_scf_component_add_boost_libraries(logging-service core)
+asterisk_scf_component_add_boost_libraries(logging-service-lib core)
 
 include_directories(${API_INCLUDE_DIR})
+asterisk_scf_component_build_library(logging-service-lib)
+target_link_libraries(logging-service-lib asterisk-scf-api)
+
+# icebox module
+asterisk_scf_component_init(logging-service CXX)
+asterisk_scf_component_add_file(logging-service main.cpp)
 asterisk_scf_component_build_icebox(logging-service)
-target_link_libraries(logging-service asterisk-scf-api)
+target_link_libraries(logging-service logging-service-lib)
 
 install(TARGETS logging-service
     LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR}
diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt
index 86e4a80..94b4643 100644
--- a/server/test/CMakeLists.txt
+++ b/server/test/CMakeLists.txt
@@ -20,6 +20,6 @@ include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_standalone(logging-service-test)
 target_link_libraries(logging-service-test asterisk-scf-api)
 
-target_link_libraries(logging-service-test logging-service)
+target_link_libraries(logging-service-test logging-service-lib)
 
 boost_add_test(logging-service-test)

commit 81a524e77144019117947ee59664922c0dcc5d5d
Author: David M. Lee <dlee at digium.com>
Date:   Wed Jan 19 12:18:10 2011 -0600

    We require cmake 2.8 or better.
    
    Now make it a specific "You're cmake is old" failure, as opposed to some
    random failure later on.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3cb69d..eb89de3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,8 +10,8 @@
 
 if(NOT integrated_build STREQUAL "true")
 
-    # Minimum we require is 2.6, any lower and stuff would fail horribly
-    cmake_minimum_required(VERSION 2.6)
+    # Minimum we require is 2.8, any lower and stuff would fail horribly
+    cmake_minimum_required(VERSION 2.8)
 
     # Include common AsteriskSCF build infrastructure
     include(cmake/AsteriskSCF.cmake)

commit b4fd8d09b52eee7c0cc552b3612b3b4e41a3c3b6
Author: David M. Lee <dlee at digium.com>
Date:   Wed Jan 12 19:06:34 2011 -0600

    Building a single API library.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fd771d..a3cb69d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,14 +49,12 @@ asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/LogOut
 asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/IceLogger.h)
 asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/Level.h)
 
-asterisk_scf_component_add_slice(logging-client LoggerIf)
-asterisk_scf_component_add_slice(logging-client ServiceLocatorIf)
-asterisk_scf_component_add_slice(logging-client ServiceLocatorEventsIf)
-
 asterisk_scf_component_add_boost_libraries(logging-client thread date_time)
 asterisk_scf_add_ice_libraries(IceStorm)
 
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_library(logging-client)
+target_link_libraries(logging-client asterisk-scf-api)
 
 install(TARGETS logging-client
     LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
diff --git a/client/test/CMakeLists.txt b/client/test/CMakeLists.txt
index c5a55fd..57160f2 100644
--- a/client/test/CMakeLists.txt
+++ b/client/test/CMakeLists.txt
@@ -19,18 +19,16 @@ asterisk_scf_component_add_file(logging-client-test client-test.cpp)
 
 asterisk_scf_component_add_boost_libraries(logging-client-test unit_test_framework)
 
-asterisk_scf_component_add_slice(logging-client-test LoggerIf)
-asterisk_scf_component_add_slice(logging-client-test ServiceLocatorIf)
-
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_standalone(logging-client-test)
 target_link_libraries(logging-client-test logging-client)
+target_link_libraries(logging-client-test asterisk-scf-api)
 
 boost_add_test(logging-client-test)
 
 asterisk_scf_component_init(scf-log CXX)
 
 asterisk_scf_component_add_file(scf-log scf-log.cpp)
-asterisk_scf_component_add_slice(scf-log LoggerIf)
 
 asterisk_scf_component_add_boost_libraries(scf-log program_options)
 
diff --git a/include/AsteriskSCF/Logger/Level.h b/include/AsteriskSCF/Logger/Level.h
index 0ebcf8a..8c4353a 100644
--- a/include/AsteriskSCF/Logger/Level.h
+++ b/include/AsteriskSCF/Logger/Level.h
@@ -9,7 +9,6 @@
 #pragma once
 
 #include <ostream>
-
 #include <AsteriskSCF/System/Logger/LoggerIf.h>
 
 namespace AsteriskSCF
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index f43a45e..741a2cb 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -10,9 +10,6 @@ asterisk_scf_component_init(logging-service CXX)
 
 include_directories(../../include)
 
-asterisk_scf_component_add_slice(logging-service LoggerIf)
-asterisk_scf_component_add_slice(logging-service ServiceLocatorIf)
-
 asterisk_scf_component_add_file(logging-service ChainedLogOut.cpp)
 asterisk_scf_component_add_file(logging-service FileChainedLogOut.cpp)
 asterisk_scf_component_add_file(logging-service LoggingServer.cpp)
@@ -27,7 +24,9 @@ asterisk_scf_component_add_file(logging-service LoggingServer.h)
 asterisk_scf_add_ice_libraries(IceStorm)
 asterisk_scf_component_add_boost_libraries(logging-service core)
 
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_icebox(logging-service)
+target_link_libraries(logging-service asterisk-scf-api)
 
 install(TARGETS logging-service
     LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR}
diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt
index a7e99e9..86e4a80 100644
--- a/server/test/CMakeLists.txt
+++ b/server/test/CMakeLists.txt
@@ -11,14 +11,14 @@ asterisk_scf_component_init(logging-service-test CXX)
 include_directories(../src)
 include_directories(../../include)
 
-asterisk_scf_component_add_slice(logging-service-test LoggerIf)
-
 asterisk_scf_component_add_file(logging-service-test LoggingServer-test.cpp)
 asterisk_scf_component_add_file(logging-service-test server-test.cpp)
 
 asterisk_scf_component_add_boost_libraries(logging-service-test unit_test_framework)
 
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_standalone(logging-service-test)
+target_link_libraries(logging-service-test asterisk-scf-api)
 
 target_link_libraries(logging-service-test logging-service)
 

commit 9e22fb80604367ec8a4e2a5cb85a65f39476ff9b
Author: David M. Lee <dlee at digium.com>
Date:   Thu Jan 13 09:38:37 2011 -0600

    Fixed install bug on Windows.
    
    Note that I'm not sure it installs properly, but it does compile properly.  And that's what's important at this point.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8c756f..0fd771d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,5 +58,7 @@ asterisk_scf_add_ice_libraries(IceStorm)
 
 asterisk_scf_component_build_library(logging-client)
 
-install(TARGETS logging-client LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR})
+install(TARGETS logging-client
+    LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
+    RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
 install(DIRECTORY include/ DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR})
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index ecd1605..f43a45e 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -29,6 +29,6 @@ asterisk_scf_component_add_boost_libraries(logging-service core)
 
 asterisk_scf_component_build_icebox(logging-service)
 
-install(TARGETS logging-service LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
-
-#asterisk_scf_component_install(logging-service RUNTIME bin "Logging Service" System)
+install(TARGETS logging-service
+    LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR}
+    RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})

commit 235472332766f44b7db41e9c589e9ab02603a912
Author: David M. Lee <dlee at digium.com>
Date:   Thu Jan 13 00:11:20 2011 -0600

    Revert "Building a single API library."
    
    This reverts commit b1a2cf3110dc9e0d397931af9c6169eee33ebe4d.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a46eead..a8c756f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,12 +49,14 @@ asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/LogOut
 asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/IceLogger.h)
 asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/Level.h)
 
+asterisk_scf_component_add_slice(logging-client LoggerIf)
+asterisk_scf_component_add_slice(logging-client ServiceLocatorIf)
+asterisk_scf_component_add_slice(logging-client ServiceLocatorEventsIf)
+
 asterisk_scf_component_add_boost_libraries(logging-client thread date_time)
 asterisk_scf_add_ice_libraries(IceStorm)
 
-include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_library(logging-client)
-target_link_libraries(logging-client asterisk-scf-api)
 
 install(TARGETS logging-client LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR})
 install(DIRECTORY include/ DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR})
diff --git a/client/test/CMakeLists.txt b/client/test/CMakeLists.txt
index 57160f2..c5a55fd 100644
--- a/client/test/CMakeLists.txt
+++ b/client/test/CMakeLists.txt
@@ -19,16 +19,18 @@ asterisk_scf_component_add_file(logging-client-test client-test.cpp)
 
 asterisk_scf_component_add_boost_libraries(logging-client-test unit_test_framework)
 
-include_directories(${API_INCLUDE_DIR})
+asterisk_scf_component_add_slice(logging-client-test LoggerIf)
+asterisk_scf_component_add_slice(logging-client-test ServiceLocatorIf)
+
 asterisk_scf_component_build_standalone(logging-client-test)
 target_link_libraries(logging-client-test logging-client)
-target_link_libraries(logging-client-test asterisk-scf-api)
 
 boost_add_test(logging-client-test)
 
 asterisk_scf_component_init(scf-log CXX)
 
 asterisk_scf_component_add_file(scf-log scf-log.cpp)
+asterisk_scf_component_add_slice(scf-log LoggerIf)
 
 asterisk_scf_component_add_boost_libraries(scf-log program_options)
 
diff --git a/include/AsteriskSCF/Logger/Level.h b/include/AsteriskSCF/Logger/Level.h
index 8c4353a..0ebcf8a 100644
--- a/include/AsteriskSCF/Logger/Level.h
+++ b/include/AsteriskSCF/Logger/Level.h
@@ -9,6 +9,7 @@
 #pragma once
 
 #include <ostream>
+
 #include <AsteriskSCF/System/Logger/LoggerIf.h>
 
 namespace AsteriskSCF
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 6b896db..ecd1605 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -10,6 +10,9 @@ asterisk_scf_component_init(logging-service CXX)
 
 include_directories(../../include)
 
+asterisk_scf_component_add_slice(logging-service LoggerIf)
+asterisk_scf_component_add_slice(logging-service ServiceLocatorIf)
+
 asterisk_scf_component_add_file(logging-service ChainedLogOut.cpp)
 asterisk_scf_component_add_file(logging-service FileChainedLogOut.cpp)
 asterisk_scf_component_add_file(logging-service LoggingServer.cpp)
@@ -24,8 +27,8 @@ asterisk_scf_component_add_file(logging-service LoggingServer.h)
 asterisk_scf_add_ice_libraries(IceStorm)
 asterisk_scf_component_add_boost_libraries(logging-service core)
 
-include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_icebox(logging-service)
-target_link_libraries(logging-service asterisk-scf-api)
 
 install(TARGETS logging-service LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
+
+#asterisk_scf_component_install(logging-service RUNTIME bin "Logging Service" System)
diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt
index 86e4a80..a7e99e9 100644
--- a/server/test/CMakeLists.txt
+++ b/server/test/CMakeLists.txt
@@ -11,14 +11,14 @@ asterisk_scf_component_init(logging-service-test CXX)
 include_directories(../src)
 include_directories(../../include)
 
+asterisk_scf_component_add_slice(logging-service-test LoggerIf)
+
 asterisk_scf_component_add_file(logging-service-test LoggingServer-test.cpp)
 asterisk_scf_component_add_file(logging-service-test server-test.cpp)
 
 asterisk_scf_component_add_boost_libraries(logging-service-test unit_test_framework)
 
-include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_standalone(logging-service-test)
-target_link_libraries(logging-service-test asterisk-scf-api)
 
 target_link_libraries(logging-service-test logging-service)
 

commit b1a2cf3110dc9e0d397931af9c6169eee33ebe4d
Author: David M. Lee <dlee at digium.com>
Date:   Wed Jan 12 19:06:34 2011 -0600

    Building a single API library.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8c756f..a46eead 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,14 +49,12 @@ asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/LogOut
 asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/IceLogger.h)
 asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/Level.h)
 
-asterisk_scf_component_add_slice(logging-client LoggerIf)
-asterisk_scf_component_add_slice(logging-client ServiceLocatorIf)
-asterisk_scf_component_add_slice(logging-client ServiceLocatorEventsIf)
-
 asterisk_scf_component_add_boost_libraries(logging-client thread date_time)
 asterisk_scf_add_ice_libraries(IceStorm)
 
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_library(logging-client)
+target_link_libraries(logging-client asterisk-scf-api)
 
 install(TARGETS logging-client LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR})
 install(DIRECTORY include/ DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR})
diff --git a/client/test/CMakeLists.txt b/client/test/CMakeLists.txt
index c5a55fd..57160f2 100644
--- a/client/test/CMakeLists.txt
+++ b/client/test/CMakeLists.txt
@@ -19,18 +19,16 @@ asterisk_scf_component_add_file(logging-client-test client-test.cpp)
 
 asterisk_scf_component_add_boost_libraries(logging-client-test unit_test_framework)
 
-asterisk_scf_component_add_slice(logging-client-test LoggerIf)
-asterisk_scf_component_add_slice(logging-client-test ServiceLocatorIf)
-
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_standalone(logging-client-test)
 target_link_libraries(logging-client-test logging-client)
+target_link_libraries(logging-client-test asterisk-scf-api)
 
 boost_add_test(logging-client-test)
 
 asterisk_scf_component_init(scf-log CXX)
 
 asterisk_scf_component_add_file(scf-log scf-log.cpp)
-asterisk_scf_component_add_slice(scf-log LoggerIf)
 
 asterisk_scf_component_add_boost_libraries(scf-log program_options)
 
diff --git a/include/AsteriskSCF/Logger/Level.h b/include/AsteriskSCF/Logger/Level.h
index 0ebcf8a..8c4353a 100644
--- a/include/AsteriskSCF/Logger/Level.h
+++ b/include/AsteriskSCF/Logger/Level.h
@@ -9,7 +9,6 @@
 #pragma once
 
 #include <ostream>
-
 #include <AsteriskSCF/System/Logger/LoggerIf.h>
 
 namespace AsteriskSCF
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index ecd1605..6b896db 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -10,9 +10,6 @@ asterisk_scf_component_init(logging-service CXX)
 
 include_directories(../../include)
 
-asterisk_scf_component_add_slice(logging-service LoggerIf)
-asterisk_scf_component_add_slice(logging-service ServiceLocatorIf)
-
 asterisk_scf_component_add_file(logging-service ChainedLogOut.cpp)
 asterisk_scf_component_add_file(logging-service FileChainedLogOut.cpp)
 asterisk_scf_component_add_file(logging-service LoggingServer.cpp)
@@ -27,8 +24,8 @@ asterisk_scf_component_add_file(logging-service LoggingServer.h)
 asterisk_scf_add_ice_libraries(IceStorm)
 asterisk_scf_component_add_boost_libraries(logging-service core)
 
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_icebox(logging-service)
+target_link_libraries(logging-service asterisk-scf-api)
 
 install(TARGETS logging-service LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
-
-#asterisk_scf_component_install(logging-service RUNTIME bin "Logging Service" System)
diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt
index a7e99e9..86e4a80 100644
--- a/server/test/CMakeLists.txt
+++ b/server/test/CMakeLists.txt
@@ -11,14 +11,14 @@ asterisk_scf_component_init(logging-service-test CXX)
 include_directories(../src)
 include_directories(../../include)
 
-asterisk_scf_component_add_slice(logging-service-test LoggerIf)
-
 asterisk_scf_component_add_file(logging-service-test LoggingServer-test.cpp)
 asterisk_scf_component_add_file(logging-service-test server-test.cpp)
 
 asterisk_scf_component_add_boost_libraries(logging-service-test unit_test_framework)
 
+include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_standalone(logging-service-test)
+target_link_libraries(logging-service-test asterisk-scf-api)
 
 target_link_libraries(logging-service-test logging-service)
 

commit 509b8256e8359e227a83c6b3afd25348e1c7d532
Author: David M. Lee <dlee at digium.com>
Date:   Mon Jan 10 14:03:45 2011 -0600

    Install

diff --git a/CMakeLists.txt b/CMakeLists.txt
index edd81ec..a8c756f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,3 +57,6 @@ asterisk_scf_component_add_boost_libraries(logging-client thread date_time)
 asterisk_scf_add_ice_libraries(IceStorm)
 
 asterisk_scf_component_build_library(logging-client)
+
+install(TARGETS logging-client LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR})
+install(DIRECTORY include/ DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR})
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 0826d82..ecd1605 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -29,4 +29,6 @@ asterisk_scf_component_add_boost_libraries(logging-service core)
 
 asterisk_scf_component_build_icebox(logging-service)
 
+install(TARGETS logging-service LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
+
 #asterisk_scf_component_install(logging-service RUNTIME bin "Logging Service" System)

commit 95463f62b2aa228f58b4583016833bbd3b5a2cc9
Author: David M. Lee <dlee at digium.com>
Date:   Wed Jan 12 18:30:34 2011 -0600

    Fixed slice #includes

diff --git a/include/AsteriskSCF/Logger/IceLogger.h b/include/AsteriskSCF/Logger/IceLogger.h
index a3ee3f7..cc74d06 100644
--- a/include/AsteriskSCF/Logger/IceLogger.h
+++ b/include/AsteriskSCF/Logger/IceLogger.h
@@ -10,8 +10,8 @@
 
 #include <Ice/Ice.h>
 
-#include "Core/Discovery/ServiceLocatorIf.h"
-#include "Core/Discovery/ServiceLocatorEventsIf.h"
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorEventsIf.h>
 #include "LogOut.h"
 
 namespace AsteriskSCF
diff --git a/include/AsteriskSCF/Logger/Level.h b/include/AsteriskSCF/Logger/Level.h
index e735bdf..0ebcf8a 100644
--- a/include/AsteriskSCF/Logger/Level.h
+++ b/include/AsteriskSCF/Logger/Level.h
@@ -10,7 +10,7 @@
 
 #include <ostream>
 
-#include "System/Logger/LoggerIf.h"
+#include <AsteriskSCF/System/Logger/LoggerIf.h>
 
 namespace AsteriskSCF
 {

commit 343eb5a60b09417f4ba706445373fabfd9040b8f
Merge: 3c13b6d 554326a
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Fri Jan 7 15:02:21 2011 -0600

    Merge branch 'master' of git.asterisk.org:asterisk-scf/release/logger


commit 3c13b6d094c74285cd6c4fd35482853290943288
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Fri Jan 7 14:54:42 2011 -0600

    Adjust #includes to use <> and prefix paths with AsteriskSCF.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72fbec5..edd81ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,4 +27,33 @@ else()
 endif()
 
 add_subdirectory(server)
-add_subdirectory(client)
+add_subdirectory(client) # For the client test directory.
+
+
+# The client component is built here, so as to be able to add files
+# from both src and include directories.
+
+asterisk_scf_component_init(logging-client CXX)
+
+include_directories(include)
+
+asterisk_scf_component_add_file(logging-client client/src/Logger.cpp)
+asterisk_scf_component_add_file(logging-client client/src/LoggerFactory.cpp)
+asterisk_scf_component_add_file(logging-client client/src/LogOut.cpp)
+asterisk_scf_component_add_file(logging-client client/src/IceConfigurator.cpp)
+asterisk_scf_component_add_file(logging-client client/src/IceLogger.cpp)
+asterisk_scf_component_add_file(logging-client client/src/OstreamLogger.cpp)
+asterisk_scf_component_add_file(logging-client client/src/IceConfigurator.h)
+asterisk_scf_component_add_file(logging-client include/AsteriskSCF/logger.h)
+asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/LogOut.h)
+asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/IceLogger.h)
+asterisk_scf_component_add_file(logging-client include/AsteriskSCF/Logger/Level.h)
+
+asterisk_scf_component_add_slice(logging-client LoggerIf)
+asterisk_scf_component_add_slice(logging-client ServiceLocatorIf)
+asterisk_scf_component_add_slice(logging-client ServiceLocatorEventsIf)
+
+asterisk_scf_component_add_boost_libraries(logging-client thread date_time)
+asterisk_scf_add_ice_libraries(IceStorm)
+
+asterisk_scf_component_build_library(logging-client)
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 6b2ef65..b38354d 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -6,5 +6,4 @@
 # All rights reserved.
 #
 
-add_subdirectory(src)
 add_subdirectory(test)
diff --git a/client/src/CMakeLists.txt b/client/src/CMakeLists.txt
deleted file mode 100644
index cdf9c90..0000000
--- a/client/src/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Asterisk Scalable Communications Framework
-#
-# Copyright (C) 2010 -- Digium, Inc.
-#
-# All rights reserved.
-#
-
-asterisk_scf_component_init(logging-client CXX)
-
-include_directories(../../common)
-
-asterisk_scf_component_add_file(logging-client Logger.cpp)
-asterisk_scf_component_add_file(logging-client LoggerFactory.cpp)
-asterisk_scf_component_add_file(logging-client LogOut.cpp)
-asterisk_scf_component_add_file(logging-client IceConfigurator.cpp)
-asterisk_scf_component_add_file(logging-client IceLogger.cpp)
-asterisk_scf_component_add_file(logging-client OstreamLogger.cpp)
-asterisk_scf_component_add_file(logging-client logger.h)
-asterisk_scf_component_add_file(logging-client IceConfigurator.h)
-asterisk_scf_component_add_file(logging-client LogOut.h)
-
-asterisk_scf_component_add_slice(logging-client LoggerIf)
-asterisk_scf_component_add_slice(logging-client ServiceLocatorIf)
-asterisk_scf_component_add_slice(logging-client ServiceLocatorEventsIf)
-
-asterisk_scf_component_add_boost_libraries(logging-client thread date_time)
-asterisk_scf_add_ice_libraries(IceStorm)
-
-asterisk_scf_component_build_library(logging-client)
diff --git a/client/src/IceConfigurator.h b/client/src/IceConfigurator.h
index 5a5d032..1742cb0 100644
--- a/client/src/IceConfigurator.h
+++ b/client/src/IceConfigurator.h
@@ -16,7 +16,7 @@
 
 #pragma once
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 namespace AsteriskSCF
 {
diff --git a/client/src/IceLogger.cpp b/client/src/IceLogger.cpp
index 2a67f4b..42622c6 100644
--- a/client/src/IceLogger.cpp
+++ b/client/src/IceLogger.cpp
@@ -16,10 +16,10 @@
 
 #include <IceStorm/IceStorm.h>
 
-#include "Core/Discovery/ServiceLocatorIf.h"
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 
-#include "IceLogger.h"
-#include "Level.h"
+#include <AsteriskSCF/Logger/IceLogger.h>
+#include <AsteriskSCF/Logger/Level.h>
 
 using namespace AsteriskSCF::Core::Discovery::V1;
 using namespace AsteriskSCF::System::Logging;
diff --git a/client/src/LogOut.cpp b/client/src/LogOut.cpp
index 7f361bb..b8a3d4a 100644
--- a/client/src/LogOut.cpp
+++ b/client/src/LogOut.cpp
@@ -14,7 +14,7 @@
  * at the top of the source tree.
  */
 
-#include "LogOut.h"
+#include <AsteriskSCF/Logger/LogOut.h>
 
 using namespace AsteriskSCF::System::Logging;
 
diff --git a/client/src/Logger.cpp b/client/src/Logger.cpp
index c1403e3..bd56c19 100644
--- a/client/src/Logger.cpp
+++ b/client/src/Logger.cpp
@@ -17,7 +17,7 @@
 #include <cassert>
 #include <cstdio>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 using namespace AsteriskSCF::System::Logging;
 
diff --git a/client/src/LoggerFactory.cpp b/client/src/LoggerFactory.cpp
index 0b1e845..3ad3c42 100644
--- a/client/src/LoggerFactory.cpp
+++ b/client/src/LoggerFactory.cpp
@@ -24,7 +24,7 @@
 
 #include <boost/algorithm/string/split.hpp>
 #include <boost/thread/once.hpp>
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 using namespace AsteriskSCF::System::Logging;
 using namespace boost::algorithm;
diff --git a/client/src/OstreamLogger.cpp b/client/src/OstreamLogger.cpp
index a1f8076..d3b35c6 100644
--- a/client/src/OstreamLogger.cpp
+++ b/client/src/OstreamLogger.cpp
@@ -14,7 +14,7 @@
  * at the top of the source tree.
  */
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 using namespace AsteriskSCF::System::Logging;
 
diff --git a/client/test/CMakeLists.txt b/client/test/CMakeLists.txt
index e52affb..c5a55fd 100644
--- a/client/test/CMakeLists.txt
+++ b/client/test/CMakeLists.txt
@@ -9,7 +9,7 @@
 asterisk_scf_component_init(logging-client-test CXX)
 
 include_directories(../src)
-include_directories(../../common)
+include_directories(../../include)
 
 asterisk_scf_component_add_file(logging-client-test Logger-test.cpp)
 asterisk_scf_component_add_file(logging-client-test LoggerFactory-test.cpp)
diff --git a/client/test/ExpectedLogOut.h b/client/test/ExpectedLogOut.h
index 1c964f7..2fdcb02 100644
--- a/client/test/ExpectedLogOut.h
+++ b/client/test/ExpectedLogOut.h
@@ -8,7 +8,7 @@
 
 #pragma once
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 
 namespace AsteriskSCF
 {
diff --git a/client/test/LogBuf-test.cpp b/client/test/LogBuf-test.cpp
index 8d035f3..845f5f6 100644
--- a/client/test/LogBuf-test.cpp
+++ b/client/test/LogBuf-test.cpp
@@ -17,7 +17,7 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 #include "ExpectedLogOut.h"
 
 using namespace AsteriskSCF::System::Logging;
diff --git a/client/test/Logger-test.cpp b/client/test/Logger-test.cpp
index dc8fea6..0964c6f 100644
--- a/client/test/Logger-test.cpp
+++ b/client/test/Logger-test.cpp
@@ -16,7 +16,7 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 #include "ExpectedLogOut.h"
 
 using namespace AsteriskSCF::System::Logging;
diff --git a/client/test/LoggerFactory-test.cpp b/client/test/LoggerFactory-test.cpp
index 160b814..ea98bcc 100644
--- a/client/test/LoggerFactory-test.cpp
+++ b/client/test/LoggerFactory-test.cpp
@@ -16,7 +16,7 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include "logger.h"
+#include <AsteriskSCF/logger.h>
 #include "ExpectedLogOut.h"
 
 using namespace AsteriskSCF::System::Logging;
diff --git a/client/test/scf-log.cpp b/client/test/scf-log.cpp
index a80beb4..c7bdf64 100644
--- a/client/test/scf-log.cpp
+++ b/client/test/scf-log.cpp
@@ -22,8 +22,8 @@
 #include <boost/program_options/variables_map.hpp>
 #include <boost/program_options/parsers.hpp>
 
-#include "IceLogger.h"
-#include "logger.h"
+#include <AsteriskSCF/Logger/IceLogger.h>
+#include <AsteriskSCF/logger.h>
 
 using namespace AsteriskSCF::System::Logging;
 namespace po = boost::program_options;
diff --git a/client/src/IceLogger.h b/include/AsteriskSCF/Logger/IceLogger.h
similarity index 100%
rename from client/src/IceLogger.h
rename to include/AsteriskSCF/Logger/IceLogger.h
diff --git a/common/Level.h b/include/AsteriskSCF/Logger/Level.h
similarity index 100%
rename from common/Level.h
rename to include/AsteriskSCF/Logger/Level.h
diff --git a/client/src/LogOut.h b/include/AsteriskSCF/Logger/LogOut.h
similarity index 95%
rename from client/src/LogOut.h
rename to include/AsteriskSCF/Logger/LogOut.h
index 1fa9911..482612f 100644
--- a/client/src/LogOut.h
+++ b/include/AsteriskSCF/Logger/LogOut.h
@@ -18,7 +18,7 @@
 
 #include <string>
 
-#include "System/Logger/LoggerIf.h"
+#include <AsteriskSCF/System/Logger/LoggerIf.h>
 
 namespace AsteriskSCF
 {
diff --git a/client/src/logger.h b/include/AsteriskSCF/logger.h
similarity index 98%
rename from client/src/logger.h
rename to include/AsteriskSCF/logger.h
index 03ed7d1..9cabc4c 100644
--- a/client/src/logger.h
+++ b/include/AsteriskSCF/logger.h
@@ -25,9 +25,9 @@
 #include <boost/thread/shared_mutex.hpp>
 #include <boost/weak_ptr.hpp>
 
-#include "System/Logger/LoggerIf.h"
-#include "Level.h"
-#include "LogOut.h"
+#include <AsteriskSCF/System/Logger/LoggerIf.h>
+#include <AsteriskSCF/Logger/Level.h>
+#include <AsteriskSCF/Logger/LogOut.h>
 
 namespace AsteriskSCF
 {
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 63e6c1e..0826d82 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -8,7 +8,7 @@
 
 asterisk_scf_component_init(logging-service CXX)
 
-include_directories(../../common)
+include_directories(../../include)
 
 asterisk_scf_component_add_slice(logging-service LoggerIf)
 asterisk_scf_component_add_slice(logging-service ServiceLocatorIf)
diff --git a/server/src/ChainedLogOut.h b/server/src/ChainedLogOut.h
index 931895b..eb5cedc 100644
--- a/server/src/ChainedLogOut.h
+++ b/server/src/ChainedLogOut.h
@@ -20,7 +20,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include "Level.h"
+#include <AsteriskSCF/Logger/Level.h>
 
 namespace AsteriskSCF
 {
diff --git a/server/src/LoggingServer.cpp b/server/src/LoggingServer.cpp
index 9ffd9eb..43428aa 100644
--- a/server/src/LoggingServer.cpp
+++ b/server/src/LoggingServer.cpp
@@ -16,8 +16,9 @@
 
 #include <iomanip>
 
+#include <AsteriskSCF/Logger/Level.h>
+
 #include "LoggingServer.h"
-#include "Level.h"
 
 using namespace AsteriskSCF::System::Logging;
 
diff --git a/server/src/LoggingServer.h b/server/src/LoggingServer.h
index 2e81a12..a557a05 100644
--- a/server/src/LoggingServer.h
+++ b/server/src/LoggingServer.h
@@ -22,7 +22,7 @@
 
 #include <Ice/Properties.h>
 
-#include "LoggerIf.h"
+#include <AsteriskSCF/System/Logger/LoggerIf.h>
 #include "ChainedLogOut.h"
 
 namespace AsteriskSCF
diff --git a/server/src/main.cpp b/server/src/main.cpp
index 73edd63..9c5ad35 100644
--- a/server/src/main.cpp
+++ b/server/src/main.cpp
@@ -19,7 +19,7 @@
 #include <IceBox/IceBox.h>
 #include <IceStorm/IceStorm.h>
 
-#include "Core/Discovery/ServiceLocatorIf.h"
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 
 #include "LoggingServer.h"
 #include "FileChainedLogOut.h"
diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt
index 62a4b9d..a7e99e9 100644
--- a/server/test/CMakeLists.txt
+++ b/server/test/CMakeLists.txt
@@ -9,7 +9,7 @@
 asterisk_scf_component_init(logging-service-test CXX)
 
 include_directories(../src)
-include_directories(../../common)
+include_directories(../../include)
 
 asterisk_scf_component_add_slice(logging-service-test LoggerIf)
 

commit 554326af9808dd5830de626e5e2ee8931168a9b6
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jan 7 07:40:18 2011 -0600

    Don't provide names for exception objects in catch() clauses unless
    the code is actually going to refer to the object in some way... otherwise
    Visual Studio complains about an unreferenced local variable.

diff --git a/server/src/main.cpp b/server/src/main.cpp
index 73edd63..54732bd 100644
--- a/server/src/main.cpp
+++ b/server/src/main.cpp
@@ -121,13 +121,13 @@ void LoggingService::start(const std::string& name,
                 {
                     topic = topicManager->retrieve(ServerConfigurationTopic);
                 }
-                catch (const IceStorm::NoSuchTopic& e)
+                catch (const IceStorm::NoSuchTopic&)
                 {
                     try
                     {
                         topic = topicManager->create(ServerConfigurationTopic);
                     }
-                    catch (const IceStorm::TopicExists& e)
+                    catch (const IceStorm::TopicExists&)
                     {
                         // we had a race to create the object w/ someone else
                         // and lost

commit 3c7e5ae1e04eef989f73b3811e713d2ab667fc9e
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Thu Jan 6 15:45:38 2011 -0600

    Added include of boost/thread/mutex.hpp required under boost 1.43 (at
    least on Windows).

diff --git a/client/src/logger.h b/client/src/logger.h
index f7f95fb..03ed7d1 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -21,6 +21,7 @@
 
 #include <boost/shared_ptr.hpp>
 #include <boost/thread/locks.hpp>
+#include <boost/thread/mutex.hpp>
 #include <boost/thread/shared_mutex.hpp>
 #include <boost/weak_ptr.hpp>
 

commit b3fcaefff15075d3d62a50868716def5d3d5641e
Author: David M. Lee <dlee at digium.com>
Date:   Tue Dec 14 18:38:33 2010 -0600

    impl -> mImpl
    
    Adjusted name to match the style guide that, for some reason, I'm
    having trouble adjusting to.  Is it me?  Is it too much like Hungarian
    notation for my subconcious to accept?  Must try harder.
    See CR-ASTSCF-24.

diff --git a/client/src/logger.h b/client/src/logger.h
index b57dcb2..f7f95fb 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -219,7 +219,7 @@ public:
     Level getEffectiveLevel() const;
 
 private:
-    boost::shared_ptr<LoggerImpl> impl;
+    boost::shared_ptr<LoggerImpl> mImpl;
 };
 
 class Logger::LoggerImpl
@@ -353,26 +353,26 @@ private:
 // since these are all simple delegates to LoggerImpl, inline them
 
 inline Logger::Logger(const boost::shared_ptr<LoggerImpl>& impl) :
-    impl(impl)
+    mImpl(impl)
 {
 }
 
 inline Logger::Logger(const std::string& name, LogOut& out, Level logLevel) :
-    impl(new LoggerImpl(name, out, logLevel))
+    mImpl(new LoggerImpl(name, out, logLevel))
 {
 }
 
 inline bool Logger::isEnabledFor(Level level) const
 {
-    return impl->isEnabledFor(level);
+    return mImpl->isEnabledFor(level);
 }
 inline CondStream Logger::operator()(Level level) const
 {
-    return (*impl)(level);
+    return (*mImpl)(level);
 }
 inline void Logger::logs(Level level, const std::string& message) const
 {
-    impl->logs(level, message);
+    mImpl->logs(level, message);
 }
 inline void Logger::logf(Level level, char const *fmt, ...) const
 {
@@ -380,7 +380,7 @@ inline void Logger::logf(Level level, char const *fmt, ...) const
     va_start(ap, fmt);
     try
     {
-        impl->vlogf(level, fmt, ap);
+        mImpl->vlogf(level, fmt, ap);
     }
     catch(...)
     {
@@ -391,39 +391,39 @@ inline void Logger::logf(Level level, char const *fmt, ...) const
 }
 inline void Logger::vlogf(Level level, char const *fmt, va_list ap) const
 {
-    impl->vlogf(level, fmt, ap);
+    mImpl->vlogf(level, fmt, ap);
 }
 inline Logger Logger::getChild(const std::string& childName)
 {
-    return impl->getChild(impl, childName);
+    return mImpl->getChild(mImpl, childName);
 }
 inline std::vector<Logger> Logger::getChildren() const
 {
-    return impl->getChildren();
+    return mImpl->getChildren();
 }
 inline const std::string& Logger::getName() const
 {
-    return impl->getName();
+    return mImpl->getName();
 }
 inline LogOut& Logger::getOutput() const
 {
-    return impl->getOutput();
+    return mImpl->getOutput();
 }
 inline void Logger::setOutput(LogOut& out)
 {
-    impl->setOutput(out);
+    mImpl->setOutput(out);
 }
 inline void Logger::setLevel(Level logLevel)
 {
-    impl->setLevel(logLevel);
+    mImpl->setLevel(logLevel);
 }
 inline void Logger::unsetLevel()
 {
-    impl->unsetLevel();
+    mImpl->unsetLevel();
 }
 inline Level Logger::getEffectiveLevel() const
 {
-    return impl->getEffectiveLevel();
+    return mImpl->getEffectiveLevel();
 }
 
 /**

commit 869c886b995992b695893795f4dcaf4b36bf43fc
Author: David M. Lee <dlee at digium.com>
Date:   Fri Dec 10 14:18:52 2010 -0600

    Changed Logger.mParent from raw ptr to weak_ptr.
    
    Raw pointers had the danger of dangling, since there's no longer any
    guarantee that parents will kill their children before dying (as
    gruesome as that sounds).  The use of weak_ptr's makes that safe, while
    avoiding memory leaks that would result from circular shared_ptr
    references.

diff --git a/client/src/Logger.cpp b/client/src/Logger.cpp
index ae74361..c1403e3 100644
--- a/client/src/Logger.cpp
+++ b/client/src/Logger.cpp
@@ -63,16 +63,18 @@ void LogBuf::sendBuffer()
 }
 
 Logger::LoggerImpl::LoggerImpl(const std::string& name, LogOut& out, Level logLevel) :
-    mParent(0), mName(name), mOut(&out), mLogLevel(logLevel), mInheritedLevel(false)
+    mParent(), mName(name), mOut(&out), mLogLevel(logLevel), mInheritedLevel(false)
 {
 }
 
-Logger::LoggerImpl::LoggerImpl(const LoggerImpl& parent, const std::string& name) :
-    mParent(&parent), mName(name), mOut(parent.mOut), mLogLevel(Off),
+Logger::LoggerImpl::LoggerImpl(const boost::shared_ptr<LoggerImpl>& parent, const std::string& name) :
+    mParent(parent), mName(name), mOut(parent->mOut), mLogLevel(Off),
     mInheritedLevel(true)
 {
+    // parent ptr must be non-null
+    assert(parent != 0);
     // our name must begin w/ parent's name
-    assert(name.find(parent.mName) == 0);
+    assert(name.find(parent->mName) == 0);
 }
 
 Logger::LoggerImpl::~LoggerImpl()
@@ -132,10 +134,13 @@ void Logger::LoggerImpl::unsetLevel()
 Level Logger::LoggerImpl::getEffectiveLevel() const
 {
     boost::shared_lock<boost::shared_mutex> lock(mLevelMutex);
+    // If parent is null, either we've never had a parent, or that
+    // parent has been destroyed.
+    boost::shared_ptr<const LoggerImpl> parent = mParent.lock();
     // if our level is unset, inherit level from our parent.
-    if (mInheritedLevel == true && mParent != 0)
+    if (mInheritedLevel == true && parent != 0)
     {
-        return mParent->getEffectiveLevel();
+        return parent->getEffectiveLevel();
     }
     else
     {
@@ -143,7 +148,8 @@ Level Logger::LoggerImpl::getEffectiveLevel() const
     }
 }
 
-Logger Logger::LoggerImpl::getChild(const std::string& childName)
+Logger Logger::LoggerImpl::getChild(const boost::shared_ptr<LoggerImpl>& self,
+    const std::string& childName)
 {
     boost::lock_guard<boost::mutex> childLock(mChildrenMutex);
 
@@ -153,7 +159,7 @@ Logger Logger::LoggerImpl::getChild(const std::string& childName)
     {
         std::string fullName = getName().empty() ? childName : getName() + "."
             + childName;
-        child.reset(new LoggerImpl(*this, fullName));
+        child.reset(new LoggerImpl(self, fullName));
     }
     return Logger(child);
 }
diff --git a/client/src/logger.h b/client/src/logger.h
index b1700b4..b57dcb2 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -22,6 +22,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/thread/locks.hpp>
 #include <boost/thread/shared_mutex.hpp>
+#include <boost/weak_ptr.hpp>
 
 #include "System/Logger/LoggerIf.h"
 #include "Level.h"
@@ -161,11 +162,6 @@ public:
     Logger(const std::string& name, LogOut& out, Level logLevel = Debug);
 
     /**
-     * Construct a child Logger.
-     */
-    Logger(const LoggerImpl& parent, const std::string& name);
-
-    /**
      * If true, this Logger would log messages of the given Level.
      *
      * @param level Level to check.
@@ -232,12 +228,14 @@ public:
     /**
      * Construct a root Logger.
      */
-    ASTERISK_SCF_ICEBOX_EXPORT LoggerImpl(const std::string& name, LogOut& out, Level logLevel = Debug);
+    ASTERISK_SCF_ICEBOX_EXPORT LoggerImpl(const std::string& name, LogOut& out,
+        Level logLevel = Debug);
 
     /**
      * Construct a child Logger.
      */
-    ASTERISK_SCF_ICEBOX_EXPORT LoggerImpl(const LoggerImpl& parent, const std::string& name);
+    ASTERISK_SCF_ICEBOX_EXPORT LoggerImpl(
+        const boost::shared_ptr<LoggerImpl>& parent, const std::string& name);
 
     ASTERISK_SCF_ICEBOX_EXPORT ~LoggerImpl();
 
@@ -270,7 +268,8 @@ public:
      */
     ASTERISK_SCF_ICEBOX_EXPORT void vlogf(Level level, char const *fmt, va_list ap) const;
 
-    ASTERISK_SCF_ICEBOX_EXPORT Logger getChild(const std::string& childName);
+    ASTERISK_SCF_ICEBOX_EXPORT Logger getChild(
+        const boost::shared_ptr<LoggerImpl>& self, const std::string& childName);
     ASTERISK_SCF_ICEBOX_EXPORT std::vector<Logger> getChildren() const;
 
     const std::string& getName() const
@@ -314,8 +313,13 @@ private:
     /**
      * Parent pointer.  We cannot change which parent we have, nor can we change
      * our parent.
+     *
+     * This can't be a shared_ptr, because then the circular reference would
+     * cause memory leaks.
+     *
+     * It also can't be a raw pointer, since children can outlive their parents.
      */
-    LoggerImpl const * const mParent;
+    boost::weak_ptr<LoggerImpl const> const mParent;
     typedef std::map<std::string, boost::shared_ptr<LoggerImpl> > Children;
     /**
      * Map of children.  The key is the next final node in that child's name.
@@ -358,11 +362,6 @@ inline Logger::Logger(const std::string& name, LogOut& out, Level logLevel) :
 {
 }
 
-inline Logger::Logger(const LoggerImpl& parent, const std::string& name) :
-    impl(new LoggerImpl(parent, name))
-{
-}
-
 inline bool Logger::isEnabledFor(Level level) const
 {
     return impl->isEnabledFor(level);
@@ -396,7 +395,7 @@ inline void Logger::vlogf(Level level, char const *fmt, va_list ap) const
 }
 inline Logger Logger::getChild(const std::string& childName)
 {
-    return impl->getChild(childName);
+    return impl->getChild(impl, childName);
 }
 inline std::vector<Logger> Logger::getChildren() const
 {

commit 71f2a6e6aec4ba5c50a678a142e44adbff3ccfcb
Author: David M. Lee <dlee at digium.com>
Date:   Fri Dec 10 13:49:00 2010 -0600

    Added reference counting to Logger.
    
    Improved confidence in using the Logger by making Logger instances
    reference counted.  This is almost source compatible, with the only
    change to users is that getLogger() now returns a Logger instance rather
    than a Logger&.

diff --git a/client/src/Logger.cpp b/client/src/Logger.cpp
index 54b6c74..ae74361 100644
--- a/client/src/Logger.cpp
+++ b/client/src/Logger.cpp
@@ -62,29 +62,29 @@ void LogBuf::sendBuffer()
     mOut.logs(nName, mLogLevel, message);
 }
 
-Logger::Logger(const std::string& name, LogOut& out, Level logLevel) :
+Logger::LoggerImpl::LoggerImpl(const std::string& name, LogOut& out, Level logLevel) :
     mParent(0), mName(name), mOut(&out), mLogLevel(logLevel), mInheritedLevel(false)
 {
 }
 
-Logger::Logger(const Logger& parent, const std::string& name) :
-    mParent(&parent), mName(name), mOut(parent.mOut), mLogLevel(Off), mInheritedLevel(
-        true)
+Logger::LoggerImpl::LoggerImpl(const LoggerImpl& parent, const std::string& name) :
+    mParent(&parent), mName(name), mOut(parent.mOut), mLogLevel(Off),
+    mInheritedLevel(true)
 {
     // our name must begin w/ parent's name
     assert(name.find(parent.mName) == 0);
 }
 
-Logger::~Logger()
+Logger::LoggerImpl::~LoggerImpl()
 {
 }
 
-CondStream Logger::operator()(Level level) const
+CondStream Logger::LoggerImpl::operator()(Level level) const
 {
     return CondStream(*mOut, mName, level, isEnabledFor(level));
 }
 
-void Logger::logs(Level level, const std::string& message) const
+void Logger::LoggerImpl::logs(Level level, const std::string& message) const
 {
     if (isEnabledFor(level))
     {
@@ -92,23 +92,7 @@ void Logger::logs(Level level, const std::string& message) const
     }
 }
 
-void Logger::logf(Level level, char const *fmt, ...) const
-{
-    va_list ap;
-    va_start(ap, fmt);
-    try
-    {
-        vlogf(level, fmt, ap);
-    }
-    catch(...)
-    {
-        va_end(ap);
-        throw;
-    }
-    va_end(ap);
-}
-
-void Logger::vlogf(Level level, char const *fmt, va_list ap) const
+void Logger::LoggerImpl::vlogf(Level level, char const *fmt, va_list ap) const
 {
     if (isEnabledFor(level))
     {
@@ -118,7 +102,7 @@ void Logger::vlogf(Level level, char const *fmt, va_list ap) const
     }
 }
 
-void Logger::setOutput(LogOut& out)
+void Logger::LoggerImpl::setOutput(LogOut& out)
 {
     this->mOut = &out;
     boost::lock_guard<boost::mutex> childLock(mChildrenMutex);
@@ -131,21 +115,21 @@ void Logger::setOutput(LogOut& out)
 }
 
 
-void Logger::setLevel(Level logLevel)
+void Logger::LoggerImpl::setLevel(Level logLevel)
 {
     boost::unique_lock<boost::shared_mutex> lock(mLevelMutex);
     mLogLevel = logLevel;
     mInheritedLevel = false;
 }
 
-void Logger::unsetLevel()
+void Logger::LoggerImpl::unsetLevel()
 {
     boost::unique_lock<boost::shared_mutex> lock(mLevelMutex);
     mInheritedLevel = true;
     mLogLevel = Off;
 }
 
-Level Logger::getEffectiveLevel() const
+Level Logger::LoggerImpl::getEffectiveLevel() const
 {
     boost::shared_lock<boost::shared_mutex> lock(mLevelMutex);
     // if our level is unset, inherit level from our parent.
@@ -159,24 +143,24 @@ Level Logger::getEffectiveLevel() const
     }
 }
 
-Logger& Logger::getChild(const std::string& childName)
+Logger Logger::LoggerImpl::getChild(const std::string& childName)
 {
     boost::lock_guard<boost::mutex> childLock(mChildrenMutex);
 
     // ref to ptr allows us to update the map in-place
-    boost::shared_ptr<Logger>& child = mChildren[childName];
+    boost::shared_ptr<LoggerImpl>& child = mChildren[childName];
     if (child == 0)
     {
         std::string fullName = getName().empty() ? childName : getName() + "."
             + childName;
-        child.reset(new Logger(*this, fullName));
+        child.reset(new LoggerImpl(*this, fullName));
     }
-    return *child;
+    return Logger(child);
 }
 
-std::vector<boost::shared_ptr<const Logger> > Logger::getChildren() const
+std::vector<Logger> Logger::LoggerImpl::getChildren() const
 {
-    std::vector<boost::shared_ptr<const Logger> > r;
+    std::vector<Logger> r;
     boost::lock_guard<boost::mutex> childLock(mChildrenMutex);
     for (Children::const_iterator i = mChildren.begin();
          i != mChildren.end();
diff --git a/client/src/LoggerFactory.cpp b/client/src/LoggerFactory.cpp
index 81e349b..0b1e845 100644
--- a/client/src/LoggerFactory.cpp
+++ b/client/src/LoggerFactory.cpp
@@ -55,7 +55,7 @@ LoggerFactory::LoggerFactory(LogOut& out) :
 {
 }
 
-Logger& LoggerFactory::getLogger(const std::string& name)
+Logger LoggerFactory::getLogger(const std::string& name)
 {
     std::vector<std::string> path;
     // older versions of boost output a single entry when splitting an empty
@@ -65,13 +65,13 @@ Logger& LoggerFactory::getLogger(const std::string& name)
         split(path, name, std::bind1st(std::equal_to<char>(), '.'));
     }
 
-    Logger *logger = &mRoot;
+    Logger logger = mRoot;
     for (std::vector<std::string>::iterator i = path.begin(); i != path.end(); ++i)
     {
-        logger = &logger->getChild(*i);
+        logger = logger.getChild(*i);
     }
 
-    return *logger;
+    return logger;
 }
 
 std::vector<std::string> LoggerFactory::getLoggerNames() const
@@ -81,16 +81,16 @@ std::vector<std::string> LoggerFactory::getLoggerNames() const
     return r;
 }
 
-void LoggerFactory::accumulateLoggerNames(const Logger& logger,
+void LoggerFactory::accumulateLoggerNames(Logger logger,
     std::vector<std::string>& out)
 {
     out.push_back(logger.getName());
     // recurse through the children
-    const std::vector<boost::shared_ptr<const Logger> >& children = logger.getChildren();
-    for (std::vector<boost::shared_ptr<const Logger> >::const_iterator i = children.begin(); i
+    const std::vector<Logger>& children = logger.getChildren();
+    for (std::vector<Logger>::const_iterator i = children.begin(); i
              != children.end(); ++i)
     {
-        accumulateLoggerNames(**i, out);
+        accumulateLoggerNames(*i, out);
     }
 }
 
diff --git a/client/src/logger.h b/client/src/logger.h
index 1e94b62..b1700b4 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -138,22 +138,108 @@ inline CondStream& CondStream::operator<<(std::ostream& (*pf)(std::ostream&))
 }
 
 /**
- * The Logger for a particular source, identified by the given name.
+ * The Logger for a particular source, identified by the given name.  This is a
+ * small wrapper class, which should be passed around by copy.
  */
 class Logger
 {
+    // You may wonder why have this class at all.  It only delegates to
+    // LoggerImpl, so why not typedef shared_ptr<LoggerImpl> LoggerPtr
+    // and use that?  The problem with that approach is that we would lose
+    // the stream style debugging, or at least may it a bit more cumbersome.
+    //   (*lg)(Debug)      << "you'd have to dereference the smart pointer"
+    //   lg->stream(Debug) << "or have a named function"
+private:
+    /** Implementation class */
+    class LoggerImpl;
+public:
+    /** Construct a Logger for an existing implementation */
+    Logger(const boost::shared_ptr<LoggerImpl>& impl);
+    /**
+     * Construct a root Logger.
+     */
+    Logger(const std::string& name, LogOut& out, Level logLevel = Debug);
+
+    /**
+     * Construct a child Logger.
+     */
+    Logger(const LoggerImpl& parent, const std::string& name);
+
+    /**
+     * If true, this Logger would log messages of the given Level.
+     *
+     * @param level Level to check.
+     * @return true if enabled for given level.
+     */
+    bool isEnabledFor(Level level) const;
+
+    /**
+     * Ostream style logging.
+     *
+     * @param level Level for messages sent to this stream.
+     * @return LogStream that logs at the given level.
+     */
+    CondStream operator()(Level level) const;
+
+    /**
+     * Log a single message.
+     */
+    void logs(Level level, const std::string& message) const;
+
+    /**
+     * Log a single printf-formatted message.
+     */
+    void logf(Level level, char const *fmt, ...) const;
+
+    /**
+     * Log a single vprintf-formatted message.
+     */
+    void vlogf(Level level, char const *fmt, va_list ap) const;
+
+    Logger getChild(const std::string& childName);
+
+    std::vector<Logger> getChildren() const;
+
+    const std::string& getName() const;
+
+    LogOut& getOutput() const;
+
+    void setOutput(LogOut& out);
+
+    /**
+     * Set's the current logLevel.  Until unsetLevel() is called, we are no
+     * longer affected by changes to our parent's log level.
+     */
+    void setLevel(Level logLevel);
+
+    /**
+     * Changes our logLevel to now inherit from out parent.
+     */
+    void unsetLevel();
+
+    /**
+     * Returns the effective level of this Logger.
+     */
+    Level getEffectiveLevel() const;
+
+private:
+    boost::shared_ptr<LoggerImpl> impl;
+};
+
+class Logger::LoggerImpl
+{
 public:
     /**
      * Construct a root Logger.
      */
-    ASTERISK_SCF_ICEBOX_EXPORT Logger(const std::string& name, LogOut& out, Level logLevel = Debug);
+    ASTERISK_SCF_ICEBOX_EXPORT LoggerImpl(const std::string& name, LogOut& out, Level logLevel = Debug);
 
     /**
      * Construct a child Logger.
      */
-    ASTERISK_SCF_ICEBOX_EXPORT Logger(const Logger& parent, const std::string& name);
+    ASTERISK_SCF_ICEBOX_EXPORT LoggerImpl(const LoggerImpl& parent, const std::string& name);
 
-    ASTERISK_SCF_ICEBOX_EXPORT ~Logger();
+    ASTERISK_SCF_ICEBOX_EXPORT ~LoggerImpl();
 
     /**
      * If true, this Logger would log messages of the given Level.
@@ -180,29 +266,19 @@ public:
     ASTERISK_SCF_ICEBOX_EXPORT void logs(Level level, const std::string& message) const;
 
     /**
-     * Log a single printf-formatted message.
-     */
-    ASTERISK_SCF_ICEBOX_EXPORT void logf(Level level, char const *fmt, ...) const;
-
-    /**
      * Log a single vprintf-formatted message.
      */
     ASTERISK_SCF_ICEBOX_EXPORT void vlogf(Level level, char const *fmt, va_list ap) const;
 
-    Logger const *getParent() const
-    {
-        return mParent;
-    }
+    ASTERISK_SCF_ICEBOX_EXPORT Logger getChild(const std::string& childName);
+    ASTERISK_SCF_ICEBOX_EXPORT std::vector<Logger> getChildren() const;
 
-    ASTERISK_SCF_ICEBOX_EXPORT Logger& getChild(const std::string& childName);
-    ASTERISK_SCF_ICEBOX_EXPORT std::vector<boost::shared_ptr<const Logger> > getChildren() const;
-
-    ASTERISK_SCF_ICEBOX_EXPORT const std::string& getName() const
+    const std::string& getName() const
     {
         return mName;
     }
 
-    ASTERISK_SCF_ICEBOX_EXPORT LogOut& getOutput() const
+    LogOut& getOutput() const
     {
         return *mOut;
     }
@@ -227,8 +303,8 @@ public:
 
 private:
     // non-copyable
-    Logger(const Logger&);
-    const Logger& operator=(const Logger&);
+    LoggerImpl(const Logger&);
+    const LoggerImpl& operator=(const LoggerImpl&);
 
     /**
      * Mutex for access to the children field.
@@ -239,8 +315,8 @@ private:
      * Parent pointer.  We cannot change which parent we have, nor can we change
      * our parent.
      */
-    Logger const * const mParent;
-    typedef std::map<std::string, boost::shared_ptr<Logger> > Children;
+    LoggerImpl const * const mParent;
+    typedef std::map<std::string, boost::shared_ptr<LoggerImpl> > Children;
     /**
      * Map of children.  The key is the next final node in that child's name.
      */
@@ -270,6 +346,87 @@ private:
     bool mInheritedLevel;
 };
 
+// since these are all simple delegates to LoggerImpl, inline them
+
+inline Logger::Logger(const boost::shared_ptr<LoggerImpl>& impl) :
+    impl(impl)
+{
+}
+
+inline Logger::Logger(const std::string& name, LogOut& out, Level logLevel) :
+    impl(new LoggerImpl(name, out, logLevel))
+{
+}
+
+inline Logger::Logger(const LoggerImpl& parent, const std::string& name) :
+    impl(new LoggerImpl(parent, name))
+{
+}
+
+inline bool Logger::isEnabledFor(Level level) const
+{
+    return impl->isEnabledFor(level);
+}
+inline CondStream Logger::operator()(Level level) const
+{
+    return (*impl)(level);
+}
+inline void Logger::logs(Level level, const std::string& message) const
+{
+    impl->logs(level, message);
+}
+inline void Logger::logf(Level level, char const *fmt, ...) const
+{
+    va_list ap;
+    va_start(ap, fmt);
+    try
+    {
+        impl->vlogf(level, fmt, ap);
+    }
+    catch(...)
+    {
+        va_end(ap);
+        throw;
+    }
+    va_end(ap);
+}
+inline void Logger::vlogf(Level level, char const *fmt, va_list ap) const
+{
+    impl->vlogf(level, fmt, ap);
+}
+inline Logger Logger::getChild(const std::string& childName)
+{
+    return impl->getChild(childName);
+}
+inline std::vector<Logger> Logger::getChildren() const
+{
+    return impl->getChildren();
+}
+inline const std::string& Logger::getName() const
+{
+    return impl->getName();
+}
+inline LogOut& Logger::getOutput() const
+{
+    return impl->getOutput();
+}
+inline void Logger::setOutput(LogOut& out)
+{
+    impl->setOutput(out);
+}
+inline void Logger::setLevel(Level logLevel)
+{
+    impl->setLevel(logLevel);
+}
+inline void Logger::unsetLevel()
+{
+    impl->unsetLevel();
+}
+inline Level Logger::getEffectiveLevel() const
+{
+    return impl->getEffectiveLevel();
+}
+
 /**
  * Main entry point into the Logger system.
  */
@@ -286,7 +443,7 @@ public:
      * @return Ref to the Logger.
      * @thread-safe
      */
-    ASTERISK_SCF_ICEBOX_EXPORT Logger& getLogger(const std::string& name);
+    ASTERISK_SCF_ICEBOX_EXPORT Logger getLogger(const std::string& name);
 
     /**
      * Returns a vector of the names of all currently configured Logger's.
@@ -299,7 +456,7 @@ public:
 private:
     Logger mRoot;
 
-    static void accumulateLoggerNames(const Logger& logger, std::vector<std::string>& out);
+    static void accumulateLoggerNames(Logger logger, std::vector<std::string>& out);
 };
 
 ASTERISK_SCF_ICEBOX_EXPORT boost::shared_ptr<LogOut> buildOstreamLogger(std::ostream& out);
diff --git a/client/test/LoggerFactory-test.cpp b/client/test/LoggerFactory-test.cpp
index 8d6c3cb..160b814 100644
--- a/client/test/LoggerFactory-test.cpp
+++ b/client/test/LoggerFactory-test.cpp
@@ -23,28 +23,16 @@ using namespace AsteriskSCF::System::Logging;
 
 BOOST_AUTO_TEST_SUITE(LoggerFactoryTest)
 
-BOOST_AUTO_TEST_CASE(testGetDistinct)
-{
-    std::stringstream tmp;
-    boost::shared_ptr<LogOut> logOut = buildOstreamLogger(tmp);
-    LoggerFactory uut(*logOut);
-
-    const Logger& asteriskScf = uut.getLogger("AsteriskSCF");
-    const Logger& core = uut.getLogger("AsteriskSCF.Core");
-
-    BOOST_CHECK_NE(&core, &asteriskScf);
-    BOOST_CHECK_EQUAL(&asteriskScf, core.getParent());
-    BOOST_CHECK_EQUAL(&uut.getLogger(""), asteriskScf.getParent());
-}
-
 BOOST_AUTO_TEST_CASE(testInheritence_off)
 {
     std::stringstream actual;
     boost::shared_ptr<LogOut> logOut = buildOstreamLogger(actual);
     LoggerFactory uut(*logOut);
 
-    Logger& root = uut.getLogger("");
-    Logger& asteriskScf = uut.getLogger("AsteriskSCF");
+    Logger root = uut.getLogger("");
+    Logger asteriskScf = uut.getLogger("AsteriskSCF");
+
+    root = asteriskScf;
 
     root.setLevel(Off);
 
@@ -58,8 +46,8 @@ BOOST_AUTO_TEST_CASE(testInheritence_on)
     boost::shared_ptr<LogOut> logOut = buildOstreamLogger(actual);
     LoggerFactory uut(*logOut);
... 2538 lines suppressed ...


-- 
asterisk-scf/integration/logger.git



More information about the asterisk-scf-commits mailing list