diff options
Diffstat (limited to 'cpp/src/Ice/Initialize.cpp')
-rw-r--r-- | cpp/src/Ice/Initialize.cpp | 26 |
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) { |