Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes Class Reference

List of all members.

Public Member Functions

def __init__
def write

Public Attributes


Detailed Description

An object that redirects `write` calls to multiple streams.
Use this to log to both `sys.stdout` and a file::

    f = open('profiler.log', 'w')
    stream = MergeStream(sys.stdout, f)
    profiler = ProfilerMiddleware(app, stream)

Definition at line 31 of file

Constructor & Destructor Documentation

Definition at line 40 of file

00041     def __init__(self, *streams):
00042         if not streams:
00043             raise TypeError('at least one stream must be given')
00044         self.streams = streams

Member Function Documentation

Definition at line 45 of file

00046     def write(self, data):
00047         for stream in self.streams:
00048             stream.write(data)

Here is the caller graph for this function:

Member Data Documentation

Definition at line 43 of file

The documentation for this class was generated from the following file: