diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/LoggerI.h | 2 | ||||
-rwxr-xr-x | cpp/src/Ice/Service.cpp | 26 |
2 files changed, 11 insertions, 17 deletions
diff --git a/cpp/src/Ice/LoggerI.h b/cpp/src/Ice/LoggerI.h index 6d11d330068..72e999efbb6 100644 --- a/cpp/src/Ice/LoggerI.h +++ b/cpp/src/Ice/LoggerI.h @@ -31,6 +31,8 @@ private: std::string _prefix; }; +typedef IceUtil::Handle<LoggerI> LoggerIPtr; + } #endif diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index 665a0c4871f..dc26a87fe42 100755 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -14,6 +14,7 @@ #include <IceUtil/Mutex.h> #include <IceUtil/ArgVector.h> #include <Ice/Service.h> +#include <Ice/LoggerI.h> #include <Ice/Initialize.h> #include <Ice/Communicator.h> #include <Ice/LocalException.h> @@ -401,24 +402,15 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initData) name = argv[idx + 1]; // - // The logger for the process is either the configured - // logger, or an event logger using the service name. + // If the process logger the default logger then we use + // our own logger. // - // We postpone the initialization of the communicator - // until serviceMain so that we can incorporate the - // executable's arguments and the service's arguments into - // one vector. - // - if(initData.logger) - { - _logger = initData.logger; - } - else - { - _logger = new SMEventLoggerI(name); - } - - setProcessLogger(_logger); + _logger = getProcessLogger(); + if(LoggerIPtr::dynamicCast(_logger)) + { + _logger = new SMEventLoggerI(name); + setProcessLogger(_logger); + } for(int i = idx; i + 2 < argc; ++i) { |