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


Python RainbowLoggingHandler._column_color['%(message)s'][VERBOSE]方法代码示例

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


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

示例1: verbose

# 需要导入模块: from rainbow_logging_handler import RainbowLoggingHandler [as 别名]
# 或者: from rainbow_logging_handler.RainbowLoggingHandler import _column_color['%(message)s'][VERBOSE] [as 别名]
import logging, sys
from rainbow_logging_handler import RainbowLoggingHandler
logging.VERBOSE = VERBOSE = 5
logging.SUCCESS = SUCCESS = logging.INFO + 5
logging.addLevelName(VERBOSE, "VERBOSE")
logging.addLevelName(SUCCESS, "SUCCESS")
def verbose(self, message, *args, **kws):
    # Yes, logger takes its '*args' as 'args'.
    if self.isEnabledFor(VERBOSE):
        self._log(VERBOSE, message, args, **kws)
logging.Logger.verbose = verbose
logging.Logger.v = verbose
def success(self, message, *args, **kws):
    # Yes, logger takes its '*args' as 'args'.
    if self.isEnabledFor(SUCCESS):
        self._log(SUCCESS, message, args, **kws)
logging.Logger.success = success
logging.Logger.ok = success
logger = logging.getLogger('dj')
formatter = logging.Formatter("[%(asctime)s] %(name)s:\t%(message)s")  # same as default
# setup `RainbowLoggingHandler`
handler = RainbowLoggingHandler(sys.stderr, color_funcName=('black', 'yellow', True))
handler.setFormatter(formatter)
handler._column_color['%(message)s'][VERBOSE] =  ('magenta', None, False)
handler._column_color['%(message)s'][SUCCESS] =  ('green', None, False)
logger.addHandler(handler)
logger.setLevel(VERBOSE)
开发者ID:nickatnight,项目名称:srvrdj,代码行数:29,代码来源:log.py


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