logger.py
Go to the documentation of this file.
00001 """
00002     redirects print message to callbacks
00003 """
00004 import sys
00005 
00006 class Logger(object):
00007     def __init__(self,default_out=None):
00008         self.terminal = default_out
00009 
00010         self.callbacks = []
00011 
00012     def addCallback(self,callback):
00013         self.callbacks.append(callback) 
00014 
00015     # Not implemented
00016     #def removeCallback
00017 
00018     def write(self,message):
00019         if self.terminal:
00020             self.terminal.write(message)
00021 
00022         for callback in self.callbacks:
00023             callback(message)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


rocon_appmanager
Author(s): Jihoon
autogenerated on Tue Jan 22 2013 12:59:53