logutil.py 文件源码

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

项目:aws-ec2rescue-linux 作者: awslabs 项目源码 文件源码
def set_direct_console_logger(cls, loglevel=logging.INFO):
        """
        Configure and add the handler for the direct console logger.

        Parameters:
            loglevel (int): numeric value of the logging level (e.g. DEBUG == 10)

        Returns:
            logger (Logger): the root logger's child named 'console'
        """
        logger = cls.get_root_logger().getChild("console")
        logger.setLevel(logging.DEBUG)
        consolehandler = logging.StreamHandler()
        consolehandler.setLevel(loglevel)
        logger.addHandler(consolehandler)
        logger.propagate = True
        return logger
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号