(
self,
level: Union[int, str] = logging.NOTSET,
console: Optional[Console] = None,
*,
show_time: bool = True,
omit_repeated_times: bool = True,
show_level: bool = True,
show_path: bool = True,
enable_link_path: bool = True,
highlighter: Optional[Highlighter] = None,
markup: bool = False,
rich_tracebacks: bool = False,
tracebacks_width: Optional[int] = None,
tracebacks_code_width: Optional[int] = 88,
tracebacks_extra_lines: int = 3,
tracebacks_theme: Optional[str] = None,
tracebacks_word_wrap: bool = True,
tracebacks_show_locals: bool = False,
tracebacks_suppress: Iterable[Union[str, ModuleType]] = (),
tracebacks_max_frames: int = 100,
locals_max_length: int = 10,
locals_max_string: int = 80,
log_time_format: Union[str, FormatTimeCallable] = "[%x %X]",
keywords: Optional[List[str]] = None,
)
| 69 | HIGHLIGHTER_CLASS: ClassVar[Type[Highlighter]] = ReprHighlighter |
| 70 | |
| 71 | def __init__( |
| 72 | self, |
| 73 | level: Union[int, str] = logging.NOTSET, |
| 74 | console: Optional[Console] = None, |
| 75 | *, |
| 76 | show_time: bool = True, |
| 77 | omit_repeated_times: bool = True, |
| 78 | show_level: bool = True, |
| 79 | show_path: bool = True, |
| 80 | enable_link_path: bool = True, |
| 81 | highlighter: Optional[Highlighter] = None, |
| 82 | markup: bool = False, |
| 83 | rich_tracebacks: bool = False, |
| 84 | tracebacks_width: Optional[int] = None, |
| 85 | tracebacks_code_width: Optional[int] = 88, |
| 86 | tracebacks_extra_lines: int = 3, |
| 87 | tracebacks_theme: Optional[str] = None, |
| 88 | tracebacks_word_wrap: bool = True, |
| 89 | tracebacks_show_locals: bool = False, |
| 90 | tracebacks_suppress: Iterable[Union[str, ModuleType]] = (), |
| 91 | tracebacks_max_frames: int = 100, |
| 92 | locals_max_length: int = 10, |
| 93 | locals_max_string: int = 80, |
| 94 | log_time_format: Union[str, FormatTimeCallable] = "[%x %X]", |
| 95 | keywords: Optional[List[str]] = None, |
| 96 | ) -> None: |
| 97 | super().__init__(level=level) |
| 98 | self.console = console or get_console() |
| 99 | self.highlighter = highlighter or self.HIGHLIGHTER_CLASS() |
| 100 | self._log_render = LogRender( |
| 101 | show_time=show_time, |
| 102 | show_level=show_level, |
| 103 | show_path=show_path, |
| 104 | time_format=log_time_format, |
| 105 | omit_repeated_times=omit_repeated_times, |
| 106 | level_width=None, |
| 107 | ) |
| 108 | self.enable_link_path = enable_link_path |
| 109 | self.markup = markup |
| 110 | self.rich_tracebacks = rich_tracebacks |
| 111 | self.tracebacks_width = tracebacks_width |
| 112 | self.tracebacks_extra_lines = tracebacks_extra_lines |
| 113 | self.tracebacks_theme = tracebacks_theme |
| 114 | self.tracebacks_word_wrap = tracebacks_word_wrap |
| 115 | self.tracebacks_show_locals = tracebacks_show_locals |
| 116 | self.tracebacks_suppress = tracebacks_suppress |
| 117 | self.tracebacks_max_frames = tracebacks_max_frames |
| 118 | self.tracebacks_code_width = tracebacks_code_width |
| 119 | self.locals_max_length = locals_max_length |
| 120 | self.locals_max_string = locals_max_string |
| 121 | self.keywords = keywords |
| 122 | |
| 123 | def get_level_text(self, record: LogRecord) -> Text: |
| 124 | """Get the level name from the record. |
nothing calls this directly
no test coverage detected