Formats the string representation of record. :param logging.LogRecord record: Record to be formatted :returns: Formatted, string representation of record :rtype: str
(self, record: logging.LogRecord)
| 195 | self.red_level = logging.WARNING |
| 196 | |
| 197 | def format(self, record: logging.LogRecord) -> str: |
| 198 | """Formats the string representation of record. |
| 199 | |
| 200 | :param logging.LogRecord record: Record to be formatted |
| 201 | |
| 202 | :returns: Formatted, string representation of record |
| 203 | :rtype: str |
| 204 | |
| 205 | """ |
| 206 | out = super().format(record) |
| 207 | if self.colored and record.levelno >= self.red_level: |
| 208 | return ''.join((util.ANSI_SGR_RED, out, util.ANSI_SGR_RESET)) |
| 209 | return out |
| 210 | |
| 211 | |
| 212 | class MemoryHandler(logging.handlers.MemoryHandler): |
no outgoing calls