當前位置: 首頁>>代碼示例>>Python>>正文


Python RainbowLoggingHandler._column_color['%(asctime)s']方法代碼示例

本文整理匯總了Python中rainbow_logging_handler.RainbowLoggingHandler._column_color['%(asctime)s']方法的典型用法代碼示例。如果您正苦於以下問題:Python RainbowLoggingHandler._column_color['%(asctime)s']方法的具體用法?Python RainbowLoggingHandler._column_color['%(asctime)s']怎麽用?Python RainbowLoggingHandler._column_color['%(asctime)s']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rainbow_logging_handler.RainbowLoggingHandler的用法示例。


在下文中一共展示了RainbowLoggingHandler._column_color['%(asctime)s']方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setup_logging

# 需要導入模塊: from rainbow_logging_handler import RainbowLoggingHandler [as 別名]
# 或者: from rainbow_logging_handler.RainbowLoggingHandler import _column_color['%(asctime)s'] [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['%(asctime)s'] [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['%(asctime)s'] [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['%(asctime)s'] [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['%(asctime)s']方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。