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
00016
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)