python类DEFAULT_LEVEL_STYLES的实例源码

__init__.py 文件源码 项目:loopchain 作者: theloopkr 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def set_log_color_set(is_leader=False):
    # level SPAM value is 5
    # level DEBUG value is 10
    if is_leader:
        coloredlogs.DEFAULT_LEVEL_STYLES = {
            'info': {},
            'notice': {'color': 'magenta'},
            'verbose': {'color': 'green'},
            'success': {'color': 'green', 'bold': True},
            'spam': {'color': 'cyan'},
            'critical': {'color': 'red', 'bold': True},
            'error': {'color': 'red'},
            'debug': {'color': 'blue'},
            'warning': {'color': 'yellow'}}
    else:
        coloredlogs.DEFAULT_LEVEL_STYLES = {
            'info': {},
            'notice': {'color': 'magenta'},
            'verbose': {'color': 'blue'},
            'success': {'color': 'green', 'bold': True},
            'spam': {'color': 'cyan'},
            'critical': {'color': 'red', 'bold': True},
            'error': {'color': 'red'},
            'debug': {'color': 'green'},
            'warning': {'color': 'yellow'}}


问题


面经


文章

微信
公众号

扫码关注公众号