From: <ror...@us...> - 2007-07-27 11:05:14
|
Revision: 127 http://roreditor.svn.sourceforge.net/roreditor/?rev=127&view=rev Author: rorthomas Date: 2007-07-27 04:05:08 -0700 (Fri, 27 Jul 2007) Log Message: ----------- * added missing file Added Paths: ----------- trunk/lib/ror/ogrelogger.py Added: trunk/lib/ror/ogrelogger.py =================================================================== --- trunk/lib/ror/ogrelogger.py (rev 0) +++ trunk/lib/ror/ogrelogger.py 2007-07-27 11:05:08 UTC (rev 127) @@ -0,0 +1,29 @@ +import ogre.renderer.OGRE as ogre +import logger + +class MyLog(ogre.LogListener): + def __init__(self): + # Creates a C++ log that will try and write to console and file + ogre.LogListener.__init__(self) + + def messageLogged(self, message, level, debug, logName): + # This should be called by Ogre instead of logging + print 'Python Logger Called -- Listener works !!!' + print ">>>", message + +def initOgreLogging(): + # Create the global log manager instance + logMgr = ogre.LogManager() + + # create a "log" + currentLog = ogre.LogManager.getSingletonPtr().createLog("ogre.log" ,True, False, False) + + #ogre.LogManager.getSingletonPtr().setDefaultLog(currentLog) + + myLog = MyLog() + # register our listener + currentLog.addListener ( myLog ) + + # And test it + ogre.LogManager.getSingletonPtr().logMessage('Should Not Appear', + ogre.LML_CRITICAL, False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |