diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-04-22 11:19:30 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-04-22 11:19:30 -0230 |
commit | 4db3e73ce821b142d0f139e30bf81a13db92ed95 (patch) | |
tree | 7742182c3816cd40b99f5b77d9d48a39c9b9953c /cpp/demo/Ice/plugin/LoggerPluginI.cpp | |
parent | Bug 3912 - fixed windows build for new plugin demo (diff) | |
download | ice-4db3e73ce821b142d0f139e30bf81a13db92ed95.tar.bz2 ice-4db3e73ce821b142d0f139e30bf81a13db92ed95.tar.xz ice-4db3e73ce821b142d0f139e30bf81a13db92ed95.zip |
Bug 3912 - added regular plugin to plugin demo
Diffstat (limited to 'cpp/demo/Ice/plugin/LoggerPluginI.cpp')
-rw-r--r-- | cpp/demo/Ice/plugin/LoggerPluginI.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/cpp/demo/Ice/plugin/LoggerPluginI.cpp b/cpp/demo/Ice/plugin/LoggerPluginI.cpp new file mode 100644 index 00000000000..d3eeefc4d01 --- /dev/null +++ b/cpp/demo/Ice/plugin/LoggerPluginI.cpp @@ -0,0 +1,57 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> + +using namespace std; + +namespace +{ + +class LoggerI : public Ice::Logger +{ +public: + + virtual void + print(const string& message) + { + cout << "PRINT: " << message << endl; + } + + virtual void + trace(const string& category, const string& message) + { + cout << "TRACE(" << category << "): " << message << endl; + } + + virtual void + warning(const string& message) + { + cout << "WARNING: " << message << endl; + } + + virtual void + error(const string& message) + { + cout << "ERROR: " << message << endl; + } +}; + +}; + +extern "C" +{ + +ICE_DECLSPEC_EXPORT ::Ice::Plugin* +createLogger(const Ice::CommunicatorPtr& communicator, const string& name, const Ice::StringSeq& args) +{ + return new Ice::LoggerPlugin(communicator, new LoggerI); +} + +} |