MCPcopy Index your code
hub / github.com/python/cpython / emit

Method emit

Lib/logging/__init__.py:1142–1162  ·  view source on GitHub ↗

Emit a record. If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream.

(self, record)

Source from the content-addressed store, hash-verified

1140 self.stream.flush()
1141
1142 def emit(self, record):
1143 """
1144 Emit a record.
1145
1146 If a formatter is specified, it is used to format the record.
1147 The record is then written to the stream with a trailing newline. If
1148 exception information is present, it is formatted using
1149 traceback.print_exception and appended to the stream. If the stream
1150 has an 'encoding' attribute, it is used to determine how to do the
1151 output to the stream.
1152 """
1153 try:
1154 msg = self.format(record)
1155 stream = self.stream
1156 # issue 35046: merged two stream.writes into one.
1157 stream.write(msg + self.terminator)
1158 self.flush()
1159 except RecursionError: # See issue 36272
1160 raise
1161 except Exception:
1162 self.handleError(record)
1163
1164 def setStream(self, stream):
1165 """

Callers

nothing calls this directly

Calls 4

flushMethod · 0.95
formatMethod · 0.45
writeMethod · 0.45
handleErrorMethod · 0.45

Tested by

no test coverage detected