(self, log_format, log_date_format, auto_indent)
| 732 | logger.disabled = True |
| 733 | |
| 734 | def _create_formatter(self, log_format, log_date_format, auto_indent): |
| 735 | # Color option doesn't exist if terminal plugin is disabled. |
| 736 | color = getattr(self._config.option, "color", "no") |
| 737 | if color != "no" and ColoredLevelFormatter.LEVELNAME_FMT_REGEX.search( |
| 738 | log_format |
| 739 | ): |
| 740 | formatter: logging.Formatter = ColoredLevelFormatter( |
| 741 | create_terminal_writer(self._config), log_format, log_date_format |
| 742 | ) |
| 743 | else: |
| 744 | formatter = DatetimeFormatter(log_format, log_date_format) |
| 745 | |
| 746 | formatter._style = PercentStyleMultiline( |
| 747 | formatter._style._fmt, auto_indent=auto_indent |
| 748 | ) |
| 749 | |
| 750 | return formatter |
| 751 | |
| 752 | def set_log_path(self, fname: str) -> None: |
| 753 | """Set the filename parameter for Logging.FileHandler(). |
no test coverage detected