[asterisk-scf-commits] asterisk-scf/integration/logger.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Sep 23 17:16:16 CDT 2010


branch "master" has been updated
       via  004b92995eeb30758c12fac714480710f618880d (commit)
       via  da754e2b303868aa06deb5b07c075dac2e91cb0d (commit)
       via  a1152cc649b90fec231b0409f3d651a864855673 (commit)
       via  737a7703a2b665fc54011799579f86dd180e14b6 (commit)
       via  ed9c8c81b1fe890e45f6ef210974baa57ce94027 (commit)
       via  168ded816a225d93301afefdaad711b8242984ad (commit)
       via  de9d396c359d3f07dceba46a368d68b4c252da20 (commit)
      from  edf236ccc7ed61007089f6c72711972d333357e1 (commit)

Summary of changes:
 .gitmodules                       |    3 +
 CMakeLists.txt                    |    4 +-
 README.txt                        |    2 +-
 client/config/logging-client.conf |    7 +++
 client/src/CMakeLists.txt         |    5 ++-
 client/src/IceLogger.cpp          |   59 +++++++++++++++++++--
 client/src/Logger.cpp             |   10 ++--
 client/src/LoggerFactory.cpp      |   35 +++++++++----
 client/src/OstreamLogger.cpp      |    4 +-
 client/src/logger.h               |   56 +++++++++++++++++----
 client/test/CMakeLists.txt        |    5 +-
 client/test/ExpectedLogOut.h      |    4 +-
 client/test/client-test.cpp       |    2 +-
 client/test/scf-log.cpp           |   38 +++++++++-----
 cmake                             |    2 +-
 common/Level.h                    |    2 +-
 ice/CMakeLists.txt                |    2 +-
 ice/LoggerIf.ice                  |  100 +++++++++++++++++++++++++++++++++++++
 ice/log4scf.ice                   |   96 -----------------------------------
 server/config/logging-server.conf |   11 ++++
 server/src/CMakeLists.txt         |    3 +-
 server/src/LoggingServer.cpp      |   50 +++++++++----------
 server/src/LoggingServer.h        |   11 ++--
 server/src/main.cpp               |   85 ++++++++++++++++++++++++++------
 server/test/CMakeLists.txt        |    4 +-
 server/test/server-test.cpp       |    2 +-
 slice                             |    1 +
 27 files changed, 396 insertions(+), 207 deletions(-)
 create mode 100644 client/config/logging-client.conf
 create mode 100644 ice/LoggerIf.ice
 delete mode 100644 ice/log4scf.ice
 create mode 100644 server/config/logging-server.conf
 create mode 160000 slice


- Log -----------------------------------------------------------------
commit 004b92995eeb30758c12fac714480710f618880d
Author: David M. Lee <dlee at digium.com>
Date:   Thu Sep 23 17:13:21 2010 -0500

    Client now has configurable server location.

diff --git a/client/config/logging-client.conf b/client/config/logging-client.conf
index f103f2f..57909d5 100644
--- a/client/config/logging-client.conf
+++ b/client/config/logging-client.conf
@@ -1,4 +1,7 @@
 # Configuration file for the logging client
 
+# Optionally directly specify LoggerServer proxy string
+#LoggerServer.Proxy=5BC84ACA-3F4C-4B78-BC75-5E6B1CC98680:tcp -h 10.24.21.100 -p 51030
+
 # Where to find the Service Locator.
 LocatorService.Proxy=LocatorService:tcp -p 4411
\ No newline at end of file
diff --git a/client/src/IceLogger.cpp b/client/src/IceLogger.cpp
index 30fddf8..8cd1002 100644
--- a/client/src/IceLogger.cpp
+++ b/client/src/IceLogger.cpp
@@ -6,8 +6,13 @@
  * All rights reserved.
  */
 
+#include <Ice/Ice.h>
+
+#include "Core/Discovery/ServiceLocatorIf.h"
+
 #include "logger.h"
 
+using namespace AsteriskSCF::Core::Discovery::V1;
 using namespace AsteriskSCF::System::Logging;
 
 namespace
@@ -17,13 +22,12 @@ class IceLogger : public LogOut
 {
 public:
    IceLogger(LoggingServerPrx const &server) :
-      // convert our proxy to a oneway proxy, so we don't block on invocations
-      server(server->ice_oneway())
+      server(server->ice_oneway()) // use oneway to not block on calls
    {
    }
 
    void logs(std::string const &name, Level logLevel,
-             std::string const &message)
+      std::string const &message)
    {
       server->logs(name, logLevel, message);
    }
@@ -34,7 +38,50 @@ private:
 
 }
 
-std::auto_ptr<LogOut> AsteriskSCF::System::Logging::buildIceLogger(LoggingServerPrx const &server)
+LoggingServerPrx AsteriskSCF::System::Logging::locateLoggerProxy(
+   Ice::CommunicatorPtr com)
+{
+   // If directly specified, use that.
+   try
+   {
+      Ice::ObjectPrx r = com->propertyToProxy("LoggerServer.Proxy");
+      if (r)
+      {
+         return LoggingServerPrx::checkedCast(r);
+      }
+   }
+   catch (std::exception const &e)
+   {
+      std::clog << "Failed to contact LoggerServer: ";
+      std::clog << e.what() << '\n';
+   }
+
+   // then try the service locator.
+   try
+   {
+      ServiceLocatorPrx locator = ServiceLocatorPrx::checkedCast(
+         com->propertyToProxy("LocatorService.Proxy"));
+
+      if (locator)
+      {
+         ServiceLocatorParamsPtr loggingServerParams =
+            new ServiceLocatorParams();
+         return LoggingServerPrx::checkedCast(locator->locate(
+            loggingServerParams));
+      }
+   }
+   catch (std::exception const &e)
+   {
+      std::clog << "Failed to contact ServiceLocator: ";
+      std::clog << e.what() << '\n';
+   }
+
+   // couldn't find the proxy
+   return LoggingServerPrx();
+}
+
+std::auto_ptr<LogOut> AsteriskSCF::System::Logging::buildIceLogger(
+   LoggingServerPrx const &server)
 {
    return std::auto_ptr<LogOut>(new IceLogger(server));
 }
diff --git a/client/src/logger.h b/client/src/logger.h
index 951328a..519d798 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -30,7 +30,7 @@ class LogOut
 public:
    virtual ~LogOut();
    virtual void logs(std::string const &name, Level logLevel,
-                     std::string const &message) = 0;
+      std::string const &message) = 0;
 };
 
 /**
@@ -74,7 +74,7 @@ class CondStream
 {
 public:
    CondStream(LogOut &out, std::string const &name, Level logLevel,
-              bool enabled) :
+      bool enabled) :
       buf(out, name, logLevel), stream(&buf), enabled(enabled)
    {
    }
@@ -263,6 +263,22 @@ private:
    Logger root;
 };
 
+/**
+ * Attempts several different methods of locating the LoggingServer.  It uses
+ * Communicator properties to find the LoggingServer.
+ *
+ * <ol>
+ *   <li><em>LoggerServer.Proxy</em> - Directly specify the proxy string for
+ *       the LoggerServer</li>
+ *   <li><em>LocatorService.Proxy</em> - Specify the proxy for the
+ *       LocatorService.</li>
+ * </ol>
+ *
+ * @return Proxy to the LoggingServer, which will be null if it could not be
+ *         located.
+ */
+LoggingServerPrx locateLoggerProxy(Ice::CommunicatorPtr communicator);
+
 std::auto_ptr<LogOut> buildIceLogger(LoggingServerPrx const &server);
 std::auto_ptr<LogOut> buildOstreamLogger(std::ostream &out);
 
diff --git a/client/test/scf-log.cpp b/client/test/scf-log.cpp
index afdc729..86d5e7d 100644
--- a/client/test/scf-log.cpp
+++ b/client/test/scf-log.cpp
@@ -9,12 +9,9 @@
 #include <Ice/Ice.h>
 #include <unistd.h>
 
-#include "Core/Discovery/ServiceLocatorIf.h"
-
 #include "logger.h"
 
 using namespace AsteriskSCF::System::Logging;
-using namespace AsteriskSCF::Core::Discovery::V1;
 
 const std::string DefaultName = "AsteriskSCF.System.Logger";
 const Level DefaultLevel = Info;
@@ -34,43 +31,6 @@ private:
 
 } // namespace
 
-LoggingServerPrx ScfLogClientApplication::getLoggerProxy()
-{
-   // first try the service locator
-   try
-   {
-      ServiceLocatorPrx locator = ServiceLocatorPrx::checkedCast(
-         communicator()->propertyToProxy("LocatorService.Proxy"));
-
-      if (locator)
-      {
-         ServiceLocatorParamsPtr loggingServerParams =
-            new ServiceLocatorParams();
-         return LoggingServerPrx::checkedCast(locator->locate(
-            loggingServerParams));
-      }
-   }
-   catch (std::exception const &e)
-   {
-      std::clog << "Failed to contact ServiceLocator: ";
-      std::clog << e.what() << '\n';
-   }
-
-   // then try direct
-   try
-   {
-      return LoggingServerPrx::checkedCast(communicator()->propertyToProxy(
-         "LoggerServerProxy"));
-   }
-   catch (std::exception const &e)
-   {
-      std::clog << "Failed to contact LoggerServer: ";
-      std::clog << e.what() << '\n';
-   }
-
-   return LoggingServerPrx();
-}
-
 int ScfLogClientApplication::run(int argc, char *argv[])
 {
    std::string name = DefaultName;
@@ -113,7 +73,7 @@ int ScfLogClientApplication::run(int argc, char *argv[])
       ++argv;
    }
 
-   LoggingServerPrx logger = getLoggerProxy();
+   LoggingServerPrx logger = locateLoggerProxy(communicator());
    if (!logger)
    {
       std::clog << "Could not get proxy to LoggingServer.\n";
diff --git a/server/config/logging-server.conf b/server/config/logging-server.conf
index 202b0fd..6428656 100644
--- a/server/config/logging-server.conf
+++ b/server/config/logging-server.conf
@@ -1,7 +1,7 @@
 # Configuration file for the logging server
 
 # Ice config
-AsteriskSCF.LoggingService.Endpoints=default -p 4433
+AsteriskSCF.LoggingService.Endpoints=default #-p 4433
 
 # A proxy to the service locator management service
 ServiceLocatorManagement.Proxy=LocatorServiceManagement:tcp -p 4422

commit da754e2b303868aa06deb5b07c075dac2e91cb0d
Author: David M. Lee <dlee at digium.com>
Date:   Thu Sep 23 16:30:38 2010 -0500

    scf-log is now configurable.  Now just need to generalize the configuration.

diff --git a/.gitmodules b/.gitmodules
index c9379ca..4efe8ad 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
 [submodule "cmake"]
 	path = cmake
 	url = git at git.asterisk.org:asterisk-scf/release/cmake
+[submodule "slice"]
+	path = slice
+	url = git at git.asterisk.org:asterisk-scf/integration/slice
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8081528..8216eb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,8 @@ if(NOT integrated_build STREQUAL "true")
    # This project is C++ based and requires a minimum of 3.4
    hydra_project("Logger" 3.4 CXX)
 
+   # Take care of slice definitions
+   add_subdirectory(slice)
 endif()
 
 add_subdirectory(ice)
diff --git a/client/config/logging-client.conf b/client/config/logging-client.conf
new file mode 100644
index 0000000..f103f2f
--- /dev/null
+++ b/client/config/logging-client.conf
@@ -0,0 +1,4 @@
+# Configuration file for the logging client
+
+# Where to find the Service Locator.
+LocatorService.Proxy=LocatorService:tcp -p 4411
\ No newline at end of file
diff --git a/client/src/CMakeLists.txt b/client/src/CMakeLists.txt
index 5b2df26..a918910 100644
--- a/client/src/CMakeLists.txt
+++ b/client/src/CMakeLists.txt
@@ -17,6 +17,7 @@ hydra_component_add_file(logging-client OstreamLogger.cpp)
 hydra_component_add_file(logging-client logger.h)
 
 hydra_component_add_slice(logging-client LoggerIf)
+hydra_component_add_slice(logging-client ServiceLocatorIf)
 
 hydra_add_boost_libraries(thread)
 
diff --git a/client/test/CMakeLists.txt b/client/test/CMakeLists.txt
index e294ed2..4ea9102 100644
--- a/client/test/CMakeLists.txt
+++ b/client/test/CMakeLists.txt
@@ -19,6 +19,7 @@ hydra_component_add_file(logging-client-test client-test.cpp)
 hydra_component_add_boost_libraries(logging-client-test unit_test_framework)
 
 hydra_component_add_slice(logging-client-test LoggerIf)
+hydra_component_add_slice(logging-client-test ServiceLocatorIf)
 
 hydra_component_build_standalone(logging-client-test)
 target_link_libraries(logging-client-test logging-client)
diff --git a/client/test/scf-log.cpp b/client/test/scf-log.cpp
index 08abfbe..afdc729 100644
--- a/client/test/scf-log.cpp
+++ b/client/test/scf-log.cpp
@@ -9,9 +9,16 @@
 #include <Ice/Ice.h>
 #include <unistd.h>
 
+#include "Core/Discovery/ServiceLocatorIf.h"
+
 #include "logger.h"
 
 using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::Core::Discovery::V1;
+
+const std::string DefaultName = "AsteriskSCF.System.Logger";
+const Level DefaultLevel = Info;
+const std::string DefaultMessage = "-- MARK --";
 
 namespace
 {
@@ -21,15 +28,55 @@ class ScfLogClientApplication : public Ice::Application
 public:
    int run(int argc, char *argv[]);
    void usage(std::ostream &out);
+private:
+   LoggingServerPrx getLoggerProxy();
 };
 
 } // namespace
 
+LoggingServerPrx ScfLogClientApplication::getLoggerProxy()
+{
+   // first try the service locator
+   try
+   {
+      ServiceLocatorPrx locator = ServiceLocatorPrx::checkedCast(
+         communicator()->propertyToProxy("LocatorService.Proxy"));
+
+      if (locator)
+      {
+         ServiceLocatorParamsPtr loggingServerParams =
+            new ServiceLocatorParams();
+         return LoggingServerPrx::checkedCast(locator->locate(
+            loggingServerParams));
+      }
+   }
+   catch (std::exception const &e)
+   {
+      std::clog << "Failed to contact ServiceLocator: ";
+      std::clog << e.what() << '\n';
+   }
+
+   // then try direct
+   try
+   {
+      return LoggingServerPrx::checkedCast(communicator()->propertyToProxy(
+         "LoggerServerProxy"));
+   }
+   catch (std::exception const &e)
+   {
+      std::clog << "Failed to contact LoggerServer: ";
+      std::clog << e.what() << '\n';
+   }
+
+   return LoggingServerPrx();
+}
+
 int ScfLogClientApplication::run(int argc, char *argv[])
 {
-   std::string name = "AsteriskSCF.System.Logger";
-   Level level = Info;
-   std::string message;
+   std::string name = DefaultName;
+   Level level = DefaultLevel;
+   std::string message = DefaultMessage;
+
    int ch;
    while ((ch = getopt(argc, argv, "p:t:")) != -1)
    {
@@ -52,23 +99,26 @@ int ScfLogClientApplication::run(int argc, char *argv[])
    argc -= optind;
    argv += optind;
 
-   while (argc-- > 0)
+   if (argc > 0)
    {
-      message += std::string(argv[0]) + " ";
+      message = std::string(argv[0]);
       ++argv;
+      --argv;
    }
 
-   if (message.empty())
+   // in case we have a multi-word message
+   while (argc-- > 0)
    {
-      // don't log empty messages
-      return EXIT_SUCCESS;
+      message += " " + std::string(argv[0]);
+      ++argv;
    }
 
-   Ice::ObjectPrx base =
-         communicator()->stringToProxy("LoggingServer:default -p 10000");
-   LoggingServerPrx logger = LoggingServerPrx::checkedCast(base);
+   LoggingServerPrx logger = getLoggerProxy();
    if (!logger)
-      throw "Invalid proxy";
+   {
+      std::clog << "Could not get proxy to LoggingServer.\n";
+      return EXIT_FAILURE;
+   }
 
    std::auto_ptr<LogOut> logOut = buildIceLogger(logger);
    LoggerFactory factory(*logOut);
diff --git a/ice/LoggerIf.ice b/ice/LoggerIf.ice
index fe8bf8b..6c0c2cd 100644
--- a/ice/LoggerIf.ice
+++ b/ice/LoggerIf.ice
@@ -15,6 +15,8 @@ module System
 module Logging
 {
 
+const string LoggingServerCategory = "LoggingServer";
+
 /**
  * Warning levels, inspired by syslog.
  */
diff --git a/server/config/logging-server.conf b/server/config/logging-server.conf
new file mode 100644
index 0000000..202b0fd
--- /dev/null
+++ b/server/config/logging-server.conf
@@ -0,0 +1,11 @@
+# Configuration file for the logging server
+
+# Ice config
+AsteriskSCF.LoggingService.Endpoints=default -p 4433
+
+# A proxy to the service locator management service
+ServiceLocatorManagement.Proxy=LocatorServiceManagement:tcp -p 4422
+
+# Log levels
+AsteriskSCF.Logging.logger=Error
+AsteriskSCF.Logging.logger.AsteriskSCF=Info
\ No newline at end of file
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 679bc86..3df642d 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -11,6 +11,7 @@ hydra_component_init(logging-service CXX)
 include_directories(../../common)
 
 hydra_component_add_slice(logging-service LoggerIf)
+hydra_component_add_slice(logging-service ServiceLocatorIf)
 
 hydra_component_add_file(logging-service LoggingServer.cpp)
 hydra_component_add_file(logging-service main.cpp)
diff --git a/server/src/LoggingServer.cpp b/server/src/LoggingServer.cpp
index d59dada..10c3c14 100644
--- a/server/src/LoggingServer.cpp
+++ b/server/src/LoggingServer.cpp
@@ -29,7 +29,9 @@ std::string getCurrentTime()
 
 } // namespace
 
-const std::string LoggingServerI::LoggingPropertyPrefix = "AsteriskSCF.Logging";
+const std::string LoggingServerI::LoggingPropertyPrefix = "AsteriskSCF.Logging.";
+const std::string RootLoggerProperty = LoggingServerI::LoggingPropertyPrefix + "logger";
+const std::string LoggerPrefix = LoggingServerI::LoggingPropertyPrefix + "logger.";
 
 bool LoggingServerI::isEnabledFor(std::string const &name, Level level) const
 {
@@ -122,25 +124,19 @@ bool LoggingServerI::isSubpathOf(std::string const &path,
 // <prefix>.logger.<name>=level
 void LoggingServerI::configure(Ice::PropertiesPtr props)
 {
-   // thread safety
-   IceUtil::Mutex::Lock sourcesLock(sourcesMutex);
-
    Ice::PropertyDict myProps =
          props->getPropertiesForPrefix(LoggingPropertyPrefix);
 
-   const std::string rootLogger = LoggingPropertyPrefix + ".logger";
-   const std::string logger = LoggingPropertyPrefix + ".logger.";
-
    for (Ice::PropertyDict::const_iterator i = myProps.begin(); i
          != myProps.end(); ++i)
    {
-      if (i->first == rootLogger)
+      if (i->first == RootLoggerProperty)
       {
          setLevel("", parseString(i->second));
       }
-      else if (i->first.find(logger) == 0)
+      else if (i->first.find(LoggerPrefix) == 0)
       {
-         std::string const &name = i->first.substr(logger.size());
+         std::string const &name = i->first.substr(LoggerPrefix.size());
          setLevel(name, parseString(i->second));
       }
       else
diff --git a/server/src/LoggingServer.h b/server/src/LoggingServer.h
index 2c57d8f..b4e2255 100644
--- a/server/src/LoggingServer.h
+++ b/server/src/LoggingServer.h
@@ -53,8 +53,7 @@ private:
 class LoggingServerI : public LoggingServer
 {
 public:
-   LoggingServerI() :
-      sources(std::greater<std::string>())
+   LoggingServerI()
    {
       sources[""] = SourceNode();
    }
diff --git a/server/src/main.cpp b/server/src/main.cpp
index 5c7af21..b634d1a 100644
--- a/server/src/main.cpp
+++ b/server/src/main.cpp
@@ -9,49 +9,104 @@
 #include <Ice/Properties.h>
 #include <Ice/Service.h>
 
+#include "Core/Discovery/ServiceLocatorIf.h"
+
 #include "LoggingServer.h"
 
 using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::Core::Discovery::V1;
 
 namespace
 {
+static const std::string AdapterName = "AsteriskSCF.LoggingService";
+
 class LoggingServerDaemon : public Ice::Service
 {
-public:
+protected:
    bool start(int argc, char *argv[], int &status);
+   bool stop();
 private:
+   Ice::ObjectAdapterPtr adapter;
+   ServiceManagementPrx serviceManagement;
+
+   void registerWithServiceLocator(LoggingServerPrx serverProxy);
+   void setupDefaultProperties();
+   void setDefaultProperty(Ice::Properties &properties, std::string const &key,
+      std::string const &defaultValue);
 };
+}
 
-Ice::PropertiesPtr parseCommandLine(int &argc, char *argv[])
+void LoggingServerDaemon::registerWithServiceLocator(
+   LoggingServerPrx serverProxy)
 {
-   Ice::PropertiesPtr props = Ice::createProperties();
-   std::vector<std::string> args(argc);
-   for (int i = 0; i < argc; ++i) {
-      args.push_back(argv[i]);
+   try
+   {
+      std::string locatorManagementProxyString =
+         communicator()->getProperties()->getProperty(
+            "ServiceLocatorManagement.Proxy");
+      if (!locatorManagementProxyString.empty())
+      {
+         ServiceLocatorManagementPrx management =
+            ServiceLocatorManagementPrx::checkedCast(
+               communicator()->stringToProxy(locatorManagementProxyString));
+         serviceManagement = management->addService(serverProxy,
+            "LoggingService");
+         ServiceLocatorParamsPtr params = new ServiceLocatorParams(LoggingServerCategory);
+         serviceManagement->addLocatorParams(params, "");
+      }
+   }
+   catch (std::exception const &e)
+   {
+      std::clog << "Logger failed to register with ServiceLocator (Ignoring): ";
+      std::clog << e.what() << '\n';
    }
-   props->parseCommandLineOptions(LoggingServerI::LoggingPropertyPrefix, args);
-   return props;
 }
+
+void LoggingServerDaemon::setupDefaultProperties()
+{
+   Ice::PropertiesPtr props = communicator()->getProperties();
+
+   setDefaultProperty(*props, AdapterName + ".Endpoints", "default");
+}
+
+void LoggingServerDaemon::setDefaultProperty(Ice::Properties &props,
+   std::string const &key, std::string const &defaultValue)
+{
+   if (props.getProperty(key).empty())
+   {
+      props.setProperty(key, defaultValue);
+   }
 }
 
 bool LoggingServerDaemon::start(int argc, char *argv[], int &status)
 {
-   Ice::PropertiesPtr props = parseCommandLine(argc, argv);
+   setupDefaultProperties();
 
-   Ice::ObjectAdapterPtr adapter =
-         communicator()->createObjectAdapterWithEndpoints("LoggingServer",
-                                                          "default -p 10000");
+   adapter = communicator()->createObjectAdapter(AdapterName);
 
    IceUtil::Handle<LoggingServerI> server = new LoggingServerI;
+   server->configure(communicator()->getProperties());
 
-   server->configure(props);
-
-   adapter->add(server, communicator()->stringToIdentity("LoggingServer"));
+   LoggingServerPrx serverProxy = LoggingServerPrx::uncheckedCast(
+      adapter->addWithUUID(server));
    adapter->activate();
+
+   std::cout << serverProxy->ice_toString() << '\n';
+   registerWithServiceLocator(serverProxy);
+
    status = EXIT_SUCCESS;
    return true;
 }
 
+bool LoggingServerDaemon::stop()
+{
+   if (serviceManagement)
+   {
+      serviceManagement->unregister();
+   }
+   return true;
+}
+
 int main(int argc, char *argv[])
 {
    LoggingServerDaemon daemon;
diff --git a/slice b/slice
new file mode 160000
index 0000000..36a57a4
--- /dev/null
+++ b/slice
@@ -0,0 +1 @@
+Subproject commit 36a57a423c849ff5688d8c4f3569bf3639feed36

commit a1152cc649b90fec231b0409f3d651a864855673
Author: David M. Lee <dlee at digium.com>
Date:   Thu Sep 23 13:02:13 2010 -0500

    Client thread safety

diff --git a/client/src/LoggerFactory.cpp b/client/src/LoggerFactory.cpp
index ce8b5e2..eb7ad36 100644
--- a/client/src/LoggerFactory.cpp
+++ b/client/src/LoggerFactory.cpp
@@ -15,12 +15,34 @@
 #include <iostream>
 
 #include <boost/algorithm/string/split.hpp>
+#include <boost/thread/once.hpp>
 
 #include "logger.h"
 
 using namespace AsteriskSCF::System::Logging;
 using namespace boost::algorithm;
 
+namespace
+{
+
+boost::once_flag oneFactory = BOOST_ONCE_INIT;
+LoggerFactory *loggerFactory = 0;
+
+void initLoggerFactory()
+{
+   static std::auto_ptr<LogOut> stdout = buildOstreamLogger(std::cout);
+   static LoggerFactory singleton(*stdout);
+   loggerFactory = &singleton;
+}
+
+}
+
+LoggerFactory &AsteriskSCF::System::Logging::getLoggerFactory()
+{
+   boost::call_once(initLoggerFactory, oneFactory);
+   return *loggerFactory;
+}
+
 LoggerFactory::LoggerFactory(LogOut &out) :
    out(out), root("", out)
 {
@@ -44,10 +66,3 @@ Logger &LoggerFactory::getLogger(std::string const &name)
 
    return *logger;
 }
-
-LoggerFactory &AsteriskSCF::System::Logging::getLoggerFactory()
-{
-   static std::auto_ptr<LogOut> stdout = buildOstreamLogger(std::cout);
-   static LoggerFactory singleton(*stdout);
-   return singleton;
-}

commit 737a7703a2b665fc54011799579f86dd180e14b6
Author: David M. Lee <dlee at digium.com>
Date:   Thu Sep 23 12:53:34 2010 -0500

    Address some threading issues on the client.

diff --git a/client/src/CMakeLists.txt b/client/src/CMakeLists.txt
index 03bb93b..5b2df26 100644
--- a/client/src/CMakeLists.txt
+++ b/client/src/CMakeLists.txt
@@ -18,4 +18,6 @@ hydra_component_add_file(logging-client logger.h)
 
 hydra_component_add_slice(logging-client LoggerIf)
 
+hydra_add_boost_libraries(thread)
+
 hydra_component_build_library(logging-client)

commit ed9c8c81b1fe890e45f6ef210974baa57ce94027
Author: David M. Lee <dlee at digium.com>
Date:   Thu Sep 23 12:51:20 2010 -0500

    source -> name

diff --git a/client/src/IceLogger.cpp b/client/src/IceLogger.cpp
index be0e576..30fddf8 100644
--- a/client/src/IceLogger.cpp
+++ b/client/src/IceLogger.cpp
@@ -22,10 +22,10 @@ public:
    {
    }
 
-   void logs(std::string const &source, Level logLevel,
+   void logs(std::string const &name, Level logLevel,
              std::string const &message)
    {
-      server->logs(source, logLevel, message);
+      server->logs(name, logLevel, message);
    }
 
 private:
diff --git a/client/src/Logger.cpp b/client/src/Logger.cpp
index 7a6a27d..c9c79c2 100644
--- a/client/src/Logger.cpp
+++ b/client/src/Logger.cpp
@@ -18,13 +18,13 @@ LogOut::~LogOut()
    // no-op
 }
 
-LogBuf::LogBuf(LogOut &out, std::string const &source, Level logLevel) :
-   out(out), source(source), logLevel(logLevel)
+LogBuf::LogBuf(LogOut &out, std::string const &name, Level logLevel) :
+   out(out), name(name), logLevel(logLevel)
 {
 }
 
 LogBuf::LogBuf(LogBuf const &orig) :
-   out(orig.out), source(orig.source), logLevel(orig.logLevel)
+   out(orig.out), name(orig.name), logLevel(orig.logLevel)
 {
    buffer.str(orig.buffer.str());
 }
@@ -54,7 +54,7 @@ void LogBuf::sendBuffer()
    std::string const &message = buffer.str();
    buffer.str("");
    // send
-   out.logs(source, logLevel, message);
+   out.logs(name, logLevel, message);
 }
 
 
@@ -120,8 +120,8 @@ void Logger::setLevel(Level logLevel)
 
 void Logger::unsetLevel()
 {
-   logLevel = Off;
    inheritedLevel = true;
+   logLevel = Off;
 }
 
 Level Logger::getEffectiveLevel() const
diff --git a/client/src/LoggerFactory.cpp b/client/src/LoggerFactory.cpp
index 4bf03cb..ce8b5e2 100644
--- a/client/src/LoggerFactory.cpp
+++ b/client/src/LoggerFactory.cpp
@@ -26,14 +26,14 @@ LoggerFactory::LoggerFactory(LogOut &out) :
 {
 }
 
-Logger &LoggerFactory::getLogger(std::string const &source)
+Logger &LoggerFactory::getLogger(std::string const &name)
 {
    std::vector<std::string> path;
    // older versions of boost output a single entry when splitting an empty
    // string
-   if (!source.empty())
+   if (!name.empty())
    {
-      split(path, source, std::bind1st(std::equal_to<char>(), '.'));
+      split(path, name, std::bind1st(std::equal_to<char>(), '.'));
    }
 
    Logger *logger = &root;
diff --git a/client/src/OstreamLogger.cpp b/client/src/OstreamLogger.cpp
index 7579645..3b64467 100644
--- a/client/src/OstreamLogger.cpp
+++ b/client/src/OstreamLogger.cpp
@@ -22,10 +22,10 @@ public:
 
    }
 
-   void logs(std::string const &source, Level logLevel,
+   void logs(std::string const &name, Level logLevel,
              std::string const &message)
    {
-      out << source << ":" << logLevel << ":" << message << '\n';
+      out << name << ":" << logLevel << ":" << message << '\n';
    }
 
 private:
diff --git a/client/src/logger.h b/client/src/logger.h
index 64fbecb..951328a 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -21,6 +21,7 @@ namespace System
 {
 namespace Logging
 {
+
 /**
  * Interface abstracting how the logs actually get written.
  */
@@ -28,7 +29,7 @@ class LogOut
 {
 public:
    virtual ~LogOut();
-   virtual void logs(std::string const &source, Level logLevel,
+   virtual void logs(std::string const &name, Level logLevel,
                      std::string const &message) = 0;
 };
 
@@ -40,7 +41,7 @@ public:
 class LogBuf : public std::streambuf
 {
 public:
-   LogBuf(LogOut &out, std::string const &source, Level logLevel);
+   LogBuf(LogOut &out, std::string const &name, Level logLevel);
 
    /**
     * Copy ctor.
@@ -56,7 +57,7 @@ protected:
 private:
    std::stringbuf buffer;
    LogOut &out;
-   const std::string source;
+   const std::string name;
    const Level logLevel;
 
    /**
@@ -72,9 +73,9 @@ private:
 class CondStream
 {
 public:
-   CondStream(LogOut &out, std::string const &source, Level logLevel,
+   CondStream(LogOut &out, std::string const &name, Level logLevel,
               bool enabled) :
-      buf(out, source, logLevel), stream(&buf), enabled(enabled)
+      buf(out, name, logLevel), stream(&buf), enabled(enabled)
    {
    }
 
@@ -122,7 +123,7 @@ inline CondStream &CondStream::operator<<(T const &val)
 }
 
 /**
- * The Logger for a particular Source.
+ * The Logger for a particular source, identified by the given name.
  */
 class Logger
 {
@@ -209,7 +210,14 @@ private:
    Logger(Logger const &);
    Logger const &operator=(Logger const &);
 
-   Logger const *parent;
+   /**
+    * Parent pointer.  We cannot change which parent we have, nor can we change
+    * our parent.
+    */
+   Logger const * const parent;
+   /**
+    * Map of children.  The key is the next final node in that child's name.
+    */
    std::map<std::string, Logger *> children;
 
    /**
@@ -238,9 +246,19 @@ class LoggerFactory
 public:
    LoggerFactory(LogOut &out);
 
-   Logger &getLogger(std::string const &source);
+   /**
+    * Will get the Logger with the given name.  If the Logger does not exist,
+    * it will be created.
+    *
+    * @param name Name of the Logger to be retrieved.
+    * @return Ref to the Logger.
+    */
+   Logger &getLogger(std::string const &name);
 
 private:
+   /**
+    * LogOut for new Logger's.
+    */
    LogOut &out;
    Logger root;
 };
diff --git a/client/test/ExpectedLogOut.h b/client/test/ExpectedLogOut.h
index a7a051e..d519b81 100644
--- a/client/test/ExpectedLogOut.h
+++ b/client/test/ExpectedLogOut.h
@@ -28,10 +28,10 @@ public:
    {
    }
 
-   void logs(std::string const &source, Level logLevel,
+   void logs(std::string const &name, Level logLevel,
              std::string const &message)
    {
-      actual << source << ":" << logLevel << ":" << message << '\n';
+      actual << name << ":" << logLevel << ":" << message << '\n';
    }
 
    void check()
diff --git a/client/test/scf-log.cpp b/client/test/scf-log.cpp
index 0d51754..08abfbe 100644
--- a/client/test/scf-log.cpp
+++ b/client/test/scf-log.cpp
@@ -27,7 +27,7 @@ public:
 
 int ScfLogClientApplication::run(int argc, char *argv[])
 {
-   std::string source = "AsteriskSCF.System.Logger";
+   std::string name = "AsteriskSCF.System.Logger";
    Level level = Info;
    std::string message;
    int ch;
@@ -39,7 +39,7 @@ int ScfLogClientApplication::run(int argc, char *argv[])
          level = parseString(optarg);
          break;
       case 't':
-         source = std::string(optarg);
+         name = std::string(optarg);
          break;
       case '?':
          usage(std::cout);
@@ -73,7 +73,7 @@ int ScfLogClientApplication::run(int argc, char *argv[])
    std::auto_ptr<LogOut> logOut = buildIceLogger(logger);
    LoggerFactory factory(*logOut);
 
-   factory.getLogger(source).logs(level, message);
+   factory.getLogger(name).logs(level, message);
    return EXIT_SUCCESS;
 }
 
diff --git a/ice/LoggerIf.ice b/ice/LoggerIf.ice
index 1defe47..fe8bf8b 100644
--- a/ice/LoggerIf.ice
+++ b/ice/LoggerIf.ice
@@ -43,23 +43,23 @@ enum Level
 sequence<string> StringSeq;
 
 /**
- * The configuration for a particular Source.
+ * The configuration for a particular name.
  */
 struct SourceConfiguration
 {
    /**
-    * A Source identifies the source component of a log message.  It can
+    * A name identifies the source component of a log message.  It can
     * be represented as a dot-notation from the source path.
-    * i.e. if the sourcePath is ["AsteriskSCF", "Core", "Routing"], then the
+    * i.e. if the path name is ["AsteriskSCF", "Core", "Routing"], then the
     * dot-notation would be "AsteriskSCF.Core.Routing".
     */
-    string source;
+    string name;
     Level logLevel;
 };
 sequence<SourceConfiguration> SourceConfigurationSeq;
 
 /**
- * Configuration for all Source's.
+ * Configuration for the LoggingServer.
  */
 struct Configuration
 {
@@ -77,7 +77,7 @@ interface LoggingServer
     * log may be a #define, hence the name logm.
     */
    ["cpp:const"]
-   idempotent void logs(string source, Level logLevel, string message);
+   idempotent void logs(string name, Level logLevel, string message);
 };
 
 /**
diff --git a/server/src/LoggingServer.cpp b/server/src/LoggingServer.cpp
index 0045fb6..d59dada 100644
--- a/server/src/LoggingServer.cpp
+++ b/server/src/LoggingServer.cpp
@@ -31,12 +31,12 @@ std::string getCurrentTime()
 
 const std::string LoggingServerI::LoggingPropertyPrefix = "AsteriskSCF.Logging";
 
-bool LoggingServerI::isEnabledFor(std::string const &source, Level level) const
+bool LoggingServerI::isEnabledFor(std::string const &name, Level level) const
 {
-   return getEffectiveLevel(source) <= level;
+   return getEffectiveLevel(name) <= level;
 }
 
-Level LoggingServerI::getEffectiveLevel(std::string const &source) const
+Level LoggingServerI::getEffectiveLevel(std::string const &name) const
 {
    // thread safety
    IceUtil::Mutex::Lock sourcesLock(sourcesMutex);
@@ -44,10 +44,10 @@ Level LoggingServerI::getEffectiveLevel(std::string const &source) const
    // this is they the map is reverse sorted.  find the first entry where
    // the source key is a substring of the source we're looking for, where
    // the substring
-   for (Sources::const_iterator i = sources.lower_bound(source);
+   for (Sources::const_iterator i = sources.lower_bound(name);
          i != sources.end(); ++i)
    {
-      if (isSubpathOf(source, i->first))
+      if (isSubpathOf(name, i->first))
       {
          return i->second.getLevel();
       }
@@ -57,37 +57,37 @@ Level LoggingServerI::getEffectiveLevel(std::string const &source) const
    return Off;
 }
 
-void LoggingServerI::setLevel(std::string const &source, Level level)
+void LoggingServerI::setLevel(std::string const &name, Level level)
 {
    // thread safety
    IceUtil::Mutex::Lock sourcesLock(sourcesMutex);
-   sources[source].setLevel(level);
+   sources[name].setLevel(level);
 }
 
-void LoggingServerI::logs(std::string const &source, Level level,
+void LoggingServerI::logs(std::string const &name, Level level,
                           const std::string &message, const Ice::Current&) const
 {
-   if (isEnabledFor(source, level))
+   if (isEnabledFor(name, level))
    {
-      reallyLog(source, level, message);
+      reallyLog(name, level, message);
    }
 }
 
-void LoggingServerI::reallyLog(std::string const &source, Level level,
+void LoggingServerI::reallyLog(std::string const &name, Level level,
                                const std::string &message) const
 {
-   // date level source(1) message
-   std::string::size_type lastDot = source.rfind('.');
+   // date level name(1) message
+   std::string::size_type lastDot = name.rfind('.');
    if (lastDot == std::string::npos)
    {
       lastDot = -1;
    }
-   std::string lastSource = source.substr(lastDot + 1);
+   std::string lastname = name.substr(lastDot + 1);
    {
       IceUtil::Mutex::Lock sourcesLock(outputMutex);
       std::ostream::fmtflags flags = std::cout.flags();
       std::cout << getCurrentTime() << ' ' << std::setw(9) << level << ' '
-            << std::setw(9) << std::left << lastSource << ' ' << message
+            << std::setw(9) << std::left << lastname << ' ' << message
             << '\n';
       std::cout.flags(flags);
    }
@@ -119,7 +119,7 @@ bool LoggingServerI::isSubpathOf(std::string const &path,
 }
 
 // <prefix>.logger=level
-// <prefix>.logger.<source>=level
+// <prefix>.logger.<name>=level
 void LoggingServerI::configure(Ice::PropertiesPtr props)
 {
    // thread safety
@@ -140,8 +140,8 @@ void LoggingServerI::configure(Ice::PropertiesPtr props)
       }
       else if (i->first.find(logger) == 0)
       {
-         std::string const &source = i->first.substr(logger.size());
-         setLevel(source, parseString(i->second));
+         std::string const &name = i->first.substr(logger.size());
+         setLevel(name, parseString(i->second));
       }
       else
       {
diff --git a/server/src/LoggingServer.h b/server/src/LoggingServer.h
index 871d113..2c57d8f 100644
--- a/server/src/LoggingServer.h
+++ b/server/src/LoggingServer.h
@@ -62,9 +62,9 @@ public:
    void logs(std::string const &, Level, const std::string&,
              const Ice::Current&) const;
 
-   bool isEnabledFor(std::string const &source, Level level) const;
-   Level getEffectiveLevel(std::string const &source) const;
-   void setLevel(std::string const &source, Level level);
+   bool isEnabledFor(std::string const &name, Level level) const;
+   Level getEffectiveLevel(std::string const &name) const;
+   void setLevel(std::string const &name, Level level);
 
    void configure(Ice::PropertiesPtr props);
 

commit 168ded816a225d93301afefdaad711b8242984ad
Author: David M. Lee <dlee at digium.com>
Date:   Thu Sep 23 09:41:10 2010 -0500

    log4scf -> Logger/LoggerIf

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c2a3c4..8081528 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ if(NOT integrated_build STREQUAL "true")
    include(cmake/AsteriskSCF.cmake)
 
    # This project is C++ based and requires a minimum of 3.4
-   hydra_project("log4scf" 3.4 CXX)
+   hydra_project("Logger" 3.4 CXX)
 
 endif()
 
diff --git a/README.txt b/README.txt
index 930debc..79d4e21 100644
--- a/README.txt
+++ b/README.txt
@@ -17,7 +17,7 @@
 --- 1) Summary
 -------------------------------------------------------------------------------
 
-The log4scf component provides a client/server logging facility for
+The Logger component provides a client/server logging facility for
 Asterisk-SCF.  The requirements are fairly straightforward:
 
  * Overall
diff --git a/client/src/CMakeLists.txt b/client/src/CMakeLists.txt
index 18ee4f1..03bb93b 100644
--- a/client/src/CMakeLists.txt
+++ b/client/src/CMakeLists.txt
@@ -16,6 +16,6 @@ hydra_component_add_file(logging-client IceLogger.cpp)
 hydra_component_add_file(logging-client OstreamLogger.cpp)
 hydra_component_add_file(logging-client logger.h)
 
-hydra_component_add_slice(logging-client log4scf)
+hydra_component_add_slice(logging-client LoggerIf)
 
 hydra_component_build_library(logging-client)
diff --git a/client/src/logger.h b/client/src/logger.h
index 01bfbb4..64fbecb 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -12,7 +12,7 @@
 #include <cstdarg>
 #include <memory>
 
-#include "log4scf.h"
+#include "LoggerIf.h"
 #include "Level.h"
 
 namespace AsteriskSCF
diff --git a/client/test/CMakeLists.txt b/client/test/CMakeLists.txt
index 099d451..e294ed2 100644
--- a/client/test/CMakeLists.txt
+++ b/client/test/CMakeLists.txt
@@ -18,7 +18,7 @@ hydra_component_add_file(logging-client-test client-test.cpp)
 
 hydra_component_add_boost_libraries(logging-client-test unit_test_framework)
 
-hydra_component_add_slice(logging-client-test log4scf)
+hydra_component_add_slice(logging-client-test LoggerIf)
 
 hydra_component_build_standalone(logging-client-test)
 target_link_libraries(logging-client-test logging-client)
@@ -28,7 +28,7 @@ boost_add_test(logging-client-test)
 hydra_component_init(scf-log CXX)
 
 hydra_component_add_file(scf-log scf-log.cpp)
-hydra_component_add_slice(scf-log log4scf)
+hydra_component_add_slice(scf-log LoggerIf)
 
 hydra_component_build_standalone(scf-log)
 target_link_libraries(scf-log logging-client)
diff --git a/client/test/client-test.cpp b/client/test/client-test.cpp
index 4558669..e5a6cad 100644
--- a/client/test/client-test.cpp
+++ b/client/test/client-test.cpp
@@ -6,5 +6,5 @@
  * All rights reserved.
  */
 
-#define BOOST_TEST_MODULE log4scf-client
+#define BOOST_TEST_MODULE Logger-client
 #include <boost/test/included/unit_test.hpp>
diff --git a/cmake b/cmake
index 9615ced..816dd27 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit 9615ced9f07f8c01ca1c8b3f2b29aa5d05a185da
+Subproject commit 816dd2725b202e71d2f284e5b9a52ab368d4210d
diff --git a/common/Level.h b/common/Level.h
index fac9add..a6f56f5 100644
--- a/common/Level.h
+++ b/common/Level.h
@@ -10,7 +10,7 @@
 
 #include <ostream>
 
-#include "log4scf.h"
+#include "LoggerIf.h"
 
 namespace AsteriskSCF
 {
diff --git a/ice/CMakeLists.txt b/ice/CMakeLists.txt
index 1f78ff5..b70a137 100644
--- a/ice/CMakeLists.txt
+++ b/ice/CMakeLists.txt
@@ -6,4 +6,4 @@
 # All rights reserved.
 #
 
-hydra_compile_slice(log4scf.ice lib "Logging API" System)
+hydra_compile_slice(LoggerIf.ice lib "Logging API" System)
diff --git a/ice/log4scf.ice b/ice/LoggerIf.ice
similarity index 100%
rename from ice/log4scf.ice
rename to ice/LoggerIf.ice
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
index 2e6f0b4..679bc86 100644
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -10,7 +10,7 @@ hydra_component_init(logging-service CXX)
 
 include_directories(../../common)
 
-hydra_component_add_slice(logging-service log4scf)
+hydra_component_add_slice(logging-service LoggerIf)
 
 hydra_component_add_file(logging-service LoggingServer.cpp)
 hydra_component_add_file(logging-service main.cpp)
diff --git a/server/src/LoggingServer.h b/server/src/LoggingServer.h
index 6d9eeb9..871d113 100644
--- a/server/src/LoggingServer.h
+++ b/server/src/LoggingServer.h
@@ -14,7 +14,7 @@
 
 #include <Ice/Properties.h>
 
-#include "log4scf.h"
+#include "LoggerIf.h"
 
 namespace AsteriskSCF
 {
diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt
index 992ed7b..5bd5dfd 100644
--- a/server/test/CMakeLists.txt
+++ b/server/test/CMakeLists.txt
@@ -11,10 +11,10 @@ hydra_component_init(logging-service-test CXX)
 include_directories(../src)
 include_directories(../../common)
 
-hydra_component_add_slice(logging-service-test log4scf)
+hydra_component_add_slice(logging-service-test LoggerIf)
 
 hydra_component_add_file(logging-service-test ../src/LoggingServer.cpp LoggingServer-test.cpp server-test.cpp)
 
 hydra_component_build_standalone(logging-service-test)
 
-boost_add_test(logging-service-test)
\ No newline at end of file
+boost_add_test(logging-service-test)
diff --git a/server/test/server-test.cpp b/server/test/server-test.cpp
index a21a7b1..5cd29dc 100644
--- a/server/test/server-test.cpp
+++ b/server/test/server-test.cpp
@@ -6,5 +6,5 @@
  * All rights reserved.
  */
 
-#define BOOST_TEST_MODULE log4scf-server
+#define BOOST_TEST_MODULE Logger-server
 #include <boost/test/included/unit_test.hpp>

commit de9d396c359d3f07dceba46a368d68b4c252da20
Author: David M. Lee <dlee at digium.com>
Date:   Thu Sep 23 09:32:05 2010 -0500

    Fixed formatting of .ice file.

diff --git a/ice/log4scf.ice b/ice/log4scf.ice
index c70909f..1defe47 100644
--- a/ice/log4scf.ice
+++ b/ice/log4scf.ice
@@ -14,83 +14,85 @@ module System
 {
 module Logging
 {
-   /**
-    * Warning levels, inspired by syslog.
-    */
-   enum Level
-   {
-      /** debug-level messages */
-      Debug,
-      /** informational messages */
-      Info,
-      /** normal but significant condition */
-      Notice,
-      /** warning conditions */
-      Warning,
-      /** error conditions */
-      Error,
-      /** critical conditions */
-      Critical,
-      /** action must be taken immediately */
-      Alert,
-      /** system is unusable */
-      Emergency,
-      /** phony level; only to be used in setting log levels */
-      Off
-   };
 
-   sequence<string> StringSeq;
+/**
+ * Warning levels, inspired by syslog.
+ */
+enum Level
+{
+   /** debug-level messages */
+   Debug,
+   /** informational messages */
+   Info,
+   /** normal but significant condition */
+   Notice,
+   /** warning conditions */
+   Warning,
+   /** error conditions */
+   Error,
+   /** critical conditions */
+   Critical,
+   /** action must be taken immediately */
+   Alert,
+   /** system is unusable */
+   Emergency,
+   /** phony level; only to be used in setting log levels */
+   Off
+};
 
-   /**
-    * The configuration for a particular Source.
-    */
-   struct SourceConfiguration
-   {
-     /**
-      * A Source identifies the source component of a log message.  It can
-      * be represented as a dot-notation from the source path.
-      * i.e. if the sourcePath is ["AsteriskSCF", "Core", "Routing"], then the
-      * dot-notation would be "AsteriskSCF.Core.Routing".
-      */
-      string source;
-      Level logLevel;
-   };
-   sequence<SourceConfiguration> SourceConfigurationSeq;
+sequence<string> StringSeq;
 
+/**
+ * The configuration for a particular Source.
+ */
+struct SourceConfiguration
+{
    /**
-    * Configuration for all Source's.
+    * A Source identifies the source component of a log message.  It can
+    * be represented as a dot-notation from the source path.
+    * i.e. if the sourcePath is ["AsteriskSCF", "Core", "Routing"], then the
+    * dot-notation would be "AsteriskSCF.Core.Routing".
     */
-   struct Configuration
-   {
-      SourceConfigurationSeq sourceSettings;
-   };
+    string source;
+    Level logLevel;
+};
+sequence<SourceConfiguration> SourceConfigurationSeq;
 
-   /**
-    * Server-side logging interface.
-    */
-   interface LoggingServer
-   {
-      /**
-       * Log a message from a given source, at a given level.  Note that
-       * server configuration may filter this message at the destination.
-       * log may be a #define, hence the name logm.
-       */
-      ["cpp:const"]
-      idempotent void logs(string source, Level logLevel, string message);
-   };
+/**
+ * Configuration for all Source's.
+ */
+struct Configuration
+{
+   SourceConfigurationSeq sourceSettings;
+};
 
+/**
+ * Server-side logging interface.
+ */
+interface LoggingServer
+{
    /**
-    * Topic name for configuration updates.
+    * Log a message from a given source, at a given level.  Note that
+    * server configuration may filter this message at the destination.
+    * log may be a #define, hence the name logm.
     */
-   const string ServerConfigurationTopic = "AsteriskSCF.System.Logging.config";
+   ["cpp:const"]
+   idempotent void logs(string source, Level logLevel, string message);
+};
+
+/**
+ * Topic name for configuration updates.
+ */
+const string ServerConfigurationTopic = "AsteriskSCF.System.Logging.config";
+
+/**
+ * Topic interface for notification of Configuration changes.
+ */
+interface ServerConfigurationListener
+{
+   void configured(LoggingServer *server, Configuration logConfiguration);
+};
 
-   /**
-    * Topic interface for notification of Configuration changes.
-    */
-   interface ServerConfigurationListener
-   {
-      void configured(LoggingServer *server, Configuration logConfiguration);
-   };
 }; // Logging
 }; // System
 }; // AsteriskSCF

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/logger.git



More information about the asterisk-scf-commits mailing list