summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Initialize.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-01-04 16:36:09 +0000
committerDwayne Boone <dwayne@zeroc.com>2007-01-04 16:36:09 +0000
commit22d5c2d7e762d35a0f46fe29c3aab8f7e5ae5b7c (patch)
treed18c790a8e35de14015ddd7b14c49bcb19c28b5b /cpp/src/Ice/Initialize.cpp
parentFixed bug 1647 (diff)
downloadice-22d5c2d7e762d35a0f46fe29c3aab8f7e5ae5b7c.tar.bz2
ice-22d5c2d7e762d35a0f46fe29c3aab8f7e5ae5b7c.tar.xz
ice-22d5c2d7e762d35a0f46fe29c3aab8f7e5ae5b7c.zip
Added process logger
Diffstat (limited to 'cpp/src/Ice/Initialize.cpp')
-rw-r--r--cpp/src/Ice/Initialize.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp
index b8b0af03cf5..1ec9985dfec 100644
--- a/cpp/src/Ice/Initialize.cpp
+++ b/cpp/src/Ice/Initialize.cpp
@@ -13,6 +13,7 @@
#include <Ice/Initialize.h>
#include <Ice/LocalException.h>
#include <Ice/StreamI.h>
+#include <Ice/LoggerI.h>
using namespace std;
using namespace Ice;
@@ -245,6 +246,31 @@ Ice::createOutputStream(const CommunicatorPtr& communicator)
return new OutputStreamI(communicator);
}
+static IceUtil::StaticMutex processLoggerMutex = ICE_STATIC_MUTEX_INITIALIZER;
+static Ice::LoggerPtr processLogger;
+
+LoggerPtr
+Ice::getProcessLogger()
+{
+ IceUtil::StaticMutex::Lock lock(processLoggerMutex);
+
+ if(processLogger == 0)
+ {
+ //
+ // TODO: Would be nice to be able to use process name as prefix by default.
+ //
+ processLogger = new Ice::LoggerI("");
+ }
+ return processLogger;
+}
+
+void
+setProcessLogger(const LoggerPtr& logger)
+{
+ IceUtil::StaticMutex::Lock lock(processLoggerMutex);
+ processLogger = logger;
+}
+
InstancePtr
IceInternal::getInstance(const CommunicatorPtr& communicator)
{