Package TEES :: Package Utils :: Module Stream
[hide private]

Module Stream

source code

Capture stdout or stderr messages to a log file

Based on code by Greg Pinero (Primary Searcher)

Capture print statments and write them to a log file but still allow them to be printed on the screen.

Classes [hide private]
  StreamModifier
This class implements a write-method and can therefore replace a stream such as sys.stderr or sys.stdout.
Functions [hide private]
 
openLog(filename='log.txt', clear=False, logCmd=True) source code
 
closeLog(filename) source code
 
writeToScreen(text) source code
 
writeToLog(text, filename=None) source code
 
setLog(filename=None, clear=False)
Replace sys.stderr and sys.stdout with a StreamModifier, capturing all output for these streams to a log file while still passing it to the original stream.
source code
 
setIndent(string=None) source code
 
setTimeStamp(format=None, duplicates=False) source code
Variables [hide private]
  __package__ = 'TEES.Utils'