logging :: StreamHandler :: Class StreamHandler
[hide private]
[frames] | no frames]

Class StreamHandler

source code

Filterer --+    
           |    
     Handler --+
               |
              StreamHandler
Known Subclasses:
FileHandler

A handler class which writes logging records, appropriately formatted, to a stream. Note that this class does not close the stream, as sys.stdout or sys.stderr may be used.

Instance Methods [hide private]
 
__init__(self, strm=None)
Initialize the handler.
source code
 
emit(self, record)
Emit a record.
source code
 
flush(self)
Flushes the stream.
source code

Inherited from Handler: acquire, close, createLock, format, handle, handleError, release, setFormatter, setLevel

Inherited from Filterer: addFilter, filter, removeFilter

Method Details [hide private]

__init__(self, strm=None)
(Constructor)

source code 

Initialize the handler.

If strm is not specified, sys.stderr is used.
Overrides: Handler.__init__

emit(self, record)

source code 

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline [N.B. this may be removed depending on feedback]. If exception information is present, it is formatted using traceback.print_exception and appended to the stream.
Overrides: Handler.emit

flush(self)

source code 
Flushes the stream.
Overrides: Handler.flush