MCPcopy
hub / github.com/tonquer/JMComic-qt / emit

Method emit

src/tools/log.py:81–101  ·  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

(self, record)

Source from the content-addressed store, hash-verified

79 logging.StreamHandler.__init__(self, stream)
80
81 def emit(self, record):
82 """
83 Emit a record.
84
85 If a formatter is specified, it is used to format the record.
86 The record is then written to the stream with a trailing newline. If
87 exception information is present, it is formatted using
88 traceback.print_exception and appended to the stream. If the stream
89 has an 'encoding' attribute, it is used to determine how to do the
90 output to the stream.
91 """
92 try:
93 msg = self.format(record)
94 stream = self.stream
95 # issue 35046: merged two stream.writes into one.
96 stream.write(record.levelno, msg + self.terminator)
97 self.flush()
98 except RecursionError: # See issue 36272
99 raise
100 except Exception:
101 self.handleError(record)
102
103 formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s", datefmt=logging.Formatter.default_time_format)
104 ch = Stream2Handler(stream2)

Callers 15

CloseReadViewMethod · 0.80
paintEventMethod · 0.80
paintEventMethod · 0.80
mousePressEventMethod · 0.80
_FinishedMethod · 0.80
setValueMethod · 0.80
OnValueChangeMethod · 0.80
closeEventMethod · 0.80
RunMethod · 0.80
RunLoad2Method · 0.80
RunMethod · 0.80
_LoadReadMethod · 0.80

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected