(self, log_format, log_date_format, auto_indent)
| 588 | self.log_cli_handler.setFormatter(log_cli_formatter) |
| 589 | |
| 590 | def _create_formatter(self, log_format, log_date_format, auto_indent): |
| 591 | # Color option doesn't exist if terminal plugin is disabled. |
| 592 | color = getattr(self._config.option, "color", "no") |
| 593 | if color != "no" and ColoredLevelFormatter.LEVELNAME_FMT_REGEX.search( |
| 594 | log_format |
| 595 | ): |
| 596 | formatter: logging.Formatter = ColoredLevelFormatter( |
| 597 | create_terminal_writer(self._config), log_format, log_date_format |
| 598 | ) |
| 599 | else: |
| 600 | formatter = logging.Formatter(log_format, log_date_format) |
| 601 | |
| 602 | formatter._style = PercentStyleMultiline( |
| 603 | formatter._style._fmt, auto_indent=auto_indent |
| 604 | ) |
| 605 | |
| 606 | return formatter |
| 607 | |
| 608 | def set_log_path(self, fname: str) -> None: |
| 609 | """Set the filename parameter for Logging.FileHandler(). |
no test coverage detected