anuga.utilities.log.TeeStream
- class anuga.utilities.log.TeeStream(logfile_path, mode='a')[source]
Bases:
objectTee sys.stdout to a file: every write goes to both terminal and file.
- Usage:
sys.stdout = TeeStream(‘run.log’) # From now on, print() and sys.stdout.write() go to both places. sys.stdout.close() # when done (optional)
Methods
__init__(logfile_path[, mode])close()flush()write(message)