Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.support.werkzeug.contrib.profiler.MergeStream Class Reference

List of all members.

Public Member Functions

def __init__
def write

Public Attributes

 streams

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 profiler.py.


Constructor & Destructor Documentation

Definition at line 40 of file profiler.py.

00040 
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 profiler.py.

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

Here is the caller graph for this function:


Member Data Documentation

Definition at line 43 of file profiler.py.


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