test_handler.py 文件源码

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

项目:python-logbook-systemd 作者: vivienm 项目源码 文件源码
def test_levels(journal, logger):
    """Mapping between log levels and Syslog priorities."""
    with JournalHandler().threadbound():
        logger.critical('Critical message')
        assert journal['PRIORITY'] == str(syslog.LOG_CRIT)
        logger.error('Error message')
        assert journal['PRIORITY'] == str(syslog.LOG_ERR)
        logger.warning('Warning message')
        assert journal['PRIORITY'] == str(syslog.LOG_WARNING)
        logger.notice('Notice message')
        assert journal['PRIORITY'] == str(syslog.LOG_NOTICE)
        logger.info('Info message')
        assert journal['PRIORITY'] == str(syslog.LOG_INFO)
        logger.debug('Debug message')
        assert journal['PRIORITY'] == str(syslog.LOG_DEBUG)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号