diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-04-29 12:51:34 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-04-29 12:51:34 -0230 |
commit | 5b4a2a64b06d1aaecb939d4f76f71aae50d76fa7 (patch) | |
tree | c3f091d08d802283767a57ad4d101799e7bbe2e3 /cpp/src/Ice/LoggerUtil.cpp | |
parent | bug 711 - Python + unicode (diff) | |
download | ice-5b4a2a64b06d1aaecb939d4f76f71aae50d76fa7.tar.bz2 ice-5b4a2a64b06d1aaecb939d4f76f71aae50d76fa7.tar.xz ice-5b4a2a64b06d1aaecb939d4f76f71aae50d76fa7.zip |
Bug 2433 - new logger plugin mechanism
Diffstat (limited to 'cpp/src/Ice/LoggerUtil.cpp')
-rw-r--r-- | cpp/src/Ice/LoggerUtil.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cpp/src/Ice/LoggerUtil.cpp b/cpp/src/Ice/LoggerUtil.cpp index a57b749b701..e015980c6d0 100644 --- a/cpp/src/Ice/LoggerUtil.cpp +++ b/cpp/src/Ice/LoggerUtil.cpp @@ -9,6 +9,9 @@ #include <Ice/LoggerUtil.h> #include <Ice/Logger.h> +#include <Ice/Plugin.h> +#include <Ice/LocalException.h> +#include <Ice/Instance.h> using namespace std; using namespace Ice; @@ -150,3 +153,29 @@ Ice::operator<<(Trace& out, ios_base& (*val)(ios_base&)) out.__str() << val; return out; } + +Ice::IceLoggerPlugin::IceLoggerPlugin(const CommunicatorPtr& communicator, + const LoggerPtr& logger) +{ + if(communicator == 0) + { + throw PluginInitializationException(__FILE__, __LINE__, "Communicator cannot be null"); + } + + IceInternal::InstancePtr instance = IceInternal::getInstance(communicator); + + if(logger != 0) + { + instance->setLogger(logger); + } +} + +void +Ice::IceLoggerPlugin::initialize() +{ +} + +void +Ice::IceLoggerPlugin::destroy() +{ +} |