def __init__(
self,
file_path: str,
mode: Optional[str] = 'a',
encoding: Optional[str] = 'utf8',
errors: Optional[str] = 'strict',
buffering: Optional[int] = 1,
name: Optional[str] = None,
level: Optional[LogLevel] = None
):
"""Instantiates a new ``FileHandler``
:param file_path: the path (full or relative) to the log file
:param mode: the file mode
:param encoding: the file encoding
:param errors: how should errors be handled
:param buffering: should the line be buffered
:param name: the name of the handler
:param level: the minimum level of verbosity/priority of the messages this will log
"""
self.fh: StreamReaderWriter = codecs.open(
file_path, mode=mode, encoding=encoding, errors=errors,
buffering=buffering)
super().__init__(name=name, level=level)
self.encoding: str = encoding
评论列表
文章目录