Lines Matching defs:stream
1070 to a stream. Note that this class does not close the stream, as
1076 def __init__(self, stream=None):
1080 If stream is not specified, sys.stderr is used.
1083 if stream is None:
1084 stream = sys.stderr
1085 self.stream = stream
1089 Flushes the stream.
1093 if self.stream and hasattr(self.stream, "flush"):
1094 self.stream.flush()
1103 The record is then written to the stream with a trailing newline. If
1105 traceback.print_exception and appended to the stream. If the stream
1107 output to the stream.
1111 stream = self.stream
1112 # issue 35046: merged two stream.writes into one.
1113 stream.write(msg + self.terminator)
1120 def setStream(self, stream):
1122 Sets the StreamHandler's stream to the specified value,
1125 Returns the old stream, if the stream was changed, or None
1128 if stream is self.stream:
1131 result = self.stream
1135 self.stream = stream
1142 name = getattr(self.stream, 'name', '')
1158 Open the specified file and use it as the stream for logging.
1176 #We don't open the stream, but we still need to call the
1179 self.stream = None
1185 Closes the stream.
1190 if self.stream:
1194 stream = self.stream
1195 self.stream = None
1196 if hasattr(stream, "close"):
1197 stream.close()
1210 Return the resulting stream.
1220 If the stream was not opened because 'delay' was specified in the
1223 If stream is not open, current mode is 'w' and `_closed=True`, record
1226 if self.stream is None:
1228 self.stream = self._open()
1229 if self.stream:
1250 def stream(self):
1980 stream Use the specified stream to initialize the StreamHandler. Note
1982 are present, 'stream' is ignored.
1999 Note that you could specify a stream created using open(filename, mode)
2001 remembered that StreamHandler does not close its stream (since it may be
2002 using sys.stdout or sys.stderr), whereas FileHandler closes its stream
2012 together with ``stream``, or ``handlers`` specified together with
2013 ``stream``.
2035 if "stream" in kwargs and "filename" in kwargs:
2036 raise ValueError("'stream' and 'filename' should not be "
2039 if "stream" in kwargs or "filename" in kwargs:
2040 raise ValueError("'stream' or 'filename' should not be "
2053 stream = kwargs.pop("stream", None)
2054 h = StreamHandler(stream)