MCPcopy Index your code
hub / github.com/RustPython/RustPython / setStream

Method setStream

Lib/logging/__init__.py:1161–1176  ·  view source on GitHub ↗

Sets the StreamHandler's stream to the specified value, if it is different. Returns the old stream, if the stream was changed, or None if it wasn't.

(self, stream)

Source from the content-addressed store, hash-verified

1159 self.handleError(record)
1160
1161 def setStream(self, stream):
1162 """
1163 Sets the StreamHandler's stream to the specified value,
1164 if it is different.
1165
1166 Returns the old stream, if the stream was changed, or None
1167 if it wasn't.
1168 """
1169 if stream is self.stream:
1170 result = None
1171 else:
1172 result = self.stream
1173 with self.lock:
1174 self.flush()
1175 self.stream = stream
1176 return result
1177
1178 def __repr__(self):
1179 level = getLevelName(self.level)

Callers 1

test_stream_settingMethod · 0.95

Calls 1

flushMethod · 0.95

Tested by 1

test_stream_settingMethod · 0.76