diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-10-12 17:11:03 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-10-12 17:11:03 +0000 |
commit | 9517936a6a9524c17322c13c345e5679265727bd (patch) | |
tree | ef3e4f414dbd47df1d54493d2fae36205d0b0cb2 /py/modules/IcePy/Logger.cpp | |
parent | bug 87: adding initialize* methods for Logger (diff) | |
download | ice-9517936a6a9524c17322c13c345e5679265727bd.tar.bz2 ice-9517936a6a9524c17322c13c345e5679265727bd.tar.xz ice-9517936a6a9524c17322c13c345e5679265727bd.zip |
changing getLogger to return a custom Python impl
Diffstat (limited to 'py/modules/IcePy/Logger.cpp')
-rw-r--r-- | py/modules/IcePy/Logger.cpp | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/py/modules/IcePy/Logger.cpp b/py/modules/IcePy/Logger.cpp index 406d077ca49..03dfd2300cd 100644 --- a/py/modules/IcePy/Logger.cpp +++ b/py/modules/IcePy/Logger.cpp @@ -11,8 +11,6 @@ # include <IceUtil/Config.h> #endif #include <Logger.h> -#include <Util.h> -#include <Ice/Logger.h> using namespace std; using namespace IcePy; @@ -28,25 +26,6 @@ struct LoggerObject Ice::LoggerPtr* logger; }; -// -// LoggerWrapper delegates Logger operations to a Python implementation. -// -class LoggerWrapper : public Ice::Logger -{ -public: - - LoggerWrapper(PyObject*); - - virtual void print(const string&); - virtual void trace(const string&, const string&); - virtual void warning(const string&); - virtual void error(const string&); - -private: - - PyObjectHandle _logger; -}; - } IcePy::LoggerWrapper::LoggerWrapper(PyObject* logger) : @@ -104,6 +83,12 @@ IcePy::LoggerWrapper::error(const string& message) } } +PyObject* +IcePy::LoggerWrapper::getObject() +{ + return _logger.get(); +} + #ifdef WIN32 extern "C" #endif @@ -329,9 +314,3 @@ IcePy::createLogger(const Ice::LoggerPtr& logger) } return (PyObject*)obj; } - -Ice::LoggerPtr -IcePy::wrapLogger(PyObject* p) -{ - return new LoggerWrapper(p); -} |