MultiplexStream¶
from acron.core import MultiplexStream
- class MultiplexStream¶
Bases:
Bases:
ostreamThis is a special ostream that forwards the data that is written to it to any number of other sources, for instance other ostreams, or explicitly to a disk file or to system logging utilities. It’s a very handy thing to set Notify to refer to when running in batch mode.
Inheritance diagram
digraph inheritancecf9fa959ed { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "MultiplexStream" [URL="acron.core.MultiplexStream.html#acron.core.MultiplexStream",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ostream" -> "MultiplexStream" [arrowsize=0.75,style=""]; "basic_ios_char" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ios_base" -> "basic_ios_char" [arrowsize=0.75,style=""]; "ios_base" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",tooltip="// We need to expose one method in each class to force it to publish."]; "DTOOL_SUPER_BASE" -> "ios_base" [arrowsize=0.75,style=""]; "ostream" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "basic_ios_char" -> "ostream" [arrowsize=0.75,style=""]; }- __init__()¶
- add_file()¶
Adds the given file to the multiplex output. The file is opened in append mode with line buffering. Returns false if the file cannot be opened.
- add_ostream()¶
Adds the indicated generic ostream to the multiplex output. The ostream will receive whatever data is sent to the pipe.
- add_standard_output()¶
Adds the standard output channel.
- add_stdio_file()¶
Adds the given file, previously opened using the C stdio library, to the multiplex output.
- add_system_debug()¶
Adds the system debug output the the multiplex output. This may map to a syslog or some such os-specific output system. It may do nothing on a particular system.
Presently, this maps only to OutputDebugString() on Windows.
- flush()¶
Forces out all output that hasn’t yet been written.