sparki_myro.py 文件源码

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

项目:sparki_learning 作者: radarjd 项目源码 文件源码
def printDebug(message, priority=logging.WARN):
    """ Logs message given the priority specified 

        arguments:
        message - the string message to be logged
        priority - the integer priority of the message; uses the priority levels in the logging module

        returns:
        nothing
    """
    # this function (and hence the library) originally did not use the logging module from the standard library
    global sparki_logger

    # for compatibility, we will recognize the "old" priority levels, but new code should be written to conform to the
    # priority levels in the logging module
    if priority == DEBUG_DEBUG or priority == logging.DEBUG:
        sparki_logger.debug(message)
    elif priority == DEBUG_INFO or priority == logging.INFO:
        sparki_logger.info(message)
    elif priority == DEBUG_WARN or priority == logging.WARN:
        sparki_logger.warn(message)
    elif priority == DEBUG_ERROR or priority == logging.ERROR:
        sparki_logger.error(message)
    else:
        sparki_logger.critical(message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号