files.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:logging2 作者: vforgione 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号