当前位置: 首页>>代码示例>>Python>>正文


Python RainbowLoggingHandler._column_color['%(levelname)-7s']方法代码示例

本文整理汇总了Python中rainbow_logging_handler.RainbowLoggingHandler._column_color['%(levelname)-7s']方法的典型用法代码示例。如果您正苦于以下问题:Python RainbowLoggingHandler._column_color['%(levelname)-7s']方法的具体用法?Python RainbowLoggingHandler._column_color['%(levelname)-7s']怎么用?Python RainbowLoggingHandler._column_color['%(levelname)-7s']使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rainbow_logging_handler.RainbowLoggingHandler的用法示例。


在下文中一共展示了RainbowLoggingHandler._column_color['%(levelname)-7s']方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_logging

# 需要导入模块: from rainbow_logging_handler import RainbowLoggingHandler [as 别名]
# 或者: from rainbow_logging_handler.RainbowLoggingHandler import _column_color['%(levelname)-7s'] [as 别名]
def setup_logging():
    log = logging.getLogger("")
    handler = RainbowLoggingHandler(sys.stderr)
    handler._column_color['%(asctime)s'] = ('cyan', None, False)
    handler._column_color['%(levelname)-7s'] = ('green', None, False)
    handler._column_color['%(message)s'][logging.INFO] = ('blue', None, False)
    handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)-7s %(name)-15s %(message)s"))
    log.addHandler(handler)
    log.setLevel(logging.INFO)
开发者ID:delfick,项目名称:cloudcity,代码行数:11,代码来源:executor.py

示例2: setup_logging

# 需要导入模块: from rainbow_logging_handler import RainbowLoggingHandler [as 别名]
# 或者: from rainbow_logging_handler.RainbowLoggingHandler import _column_color['%(levelname)-7s'] [as 别名]
def setup_logging(verbose=False):
    log = logging.getLogger("")
    handler = RainbowLoggingHandler(sys.stderr)
    handler._column_color['%(asctime)s'] = ('cyan', None, False)
    handler._column_color['%(levelname)-7s'] = ('green', None, False)
    handler._column_color['%(message)s'][logging.INFO] = ('blue', None, False)
    handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)-7s %(name)-15s %(message)s"))
    log.addHandler(handler)
    log.setLevel([logging.INFO, logging.DEBUG][verbose])

    logging.getLogger("boto").level = logging.CRITICAL
开发者ID:realestate-com-au,项目名称:iam_syncr,代码行数:13,代码来源:executor.py

示例3: setup_logging

# 需要导入模块: from rainbow_logging_handler import RainbowLoggingHandler [as 别名]
# 或者: from rainbow_logging_handler.RainbowLoggingHandler import _column_color['%(levelname)-7s'] [as 别名]
def setup_logging(verbose=False, silent=False, debug=False):
    log = logging.getLogger("")
    handler = RainbowLoggingHandler(sys.stderr)
    handler._column_color['%(asctime)s'] = ('cyan', None, False)
    handler._column_color['%(levelname)-7s'] = ('green', None, False)
    handler._column_color['%(message)s'][logging.INFO] = ('blue', None, False)
    handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)-7s %(name)-15s %(message)s"))
    log.addHandler(handler)
    log.setLevel([logging.INFO, logging.DEBUG][verbose or debug])
    if silent:
        log.setLevel(logging.ERROR)

    logging.getLogger("requests").setLevel([logging.CRITICAL, logging.ERROR][verbose or debug])
    return handler
开发者ID:CaseyLeask,项目名称:harpoon,代码行数:16,代码来源:executor.py

示例4: setup_logging

# 需要导入模块: from rainbow_logging_handler import RainbowLoggingHandler [as 别名]
# 或者: from rainbow_logging_handler.RainbowLoggingHandler import _column_color['%(levelname)-7s'] [as 别名]
    def setup_logging(self, args, verbose=False, silent=False, debug=False, logging_name=""):
        """Setup the RainbowLoggingHandler for the logs and call setup_other_logging"""
        log = logging.getLogger(logging_name)
        handler = RainbowLoggingHandler(self.logging_handler_file)
        handler._column_color['%(asctime)s'] = ('cyan', None, False)
        handler._column_color['%(levelname)-7s'] = ('green', None, False)
        handler._column_color['%(message)s'][logging.INFO] = ('blue', None, False)
        handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)-7s %(name)-15s %(message)s"))
        log.addHandler(handler)
        log.setLevel([logging.INFO, logging.DEBUG][verbose or debug])
        if silent:
            log.setLevel(logging.ERROR)

        self.setup_other_logging(args, verbose, silent, debug)
        return handler
开发者ID:jonhiggs,项目名称:delfick_app,代码行数:17,代码来源:delfick_app.py


注:本文中的rainbow_logging_handler.RainbowLoggingHandler._column_color['%(levelname)-7s']方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。