python类LOG_INFO的实例源码

test_syslog.py 文件源码 项目:zenchmarks 作者: squeaky-pl 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_emitMultilineMessage(self):
        """
        Each line of a multiline message is emitted separately to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])
test_syslog.py 文件源码 项目:zenchmarks 作者: squeaky-pl 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def test_emitStripsTrailingEmptyLines(self):
        """
        Trailing empty lines of a multiline message are omitted from the
        messages sent to the syslog.
        """
        self.observer.emit({
                'message': ('hello,\nworld\n\n',), 'isError': False,
                'system': '-'})
        self.assertEqual(
            self.events,
            [(stdsyslog.LOG_INFO, '[-] hello,'),
             (stdsyslog.LOG_INFO, '[-] \tworld')])
?????????.py 文件源码 项目:anytools 作者: ucookie 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self):
        """
        ????????
        """
        self.facility = syslog.LOG_USER
        self.severity = syslog.LOG_INFO
        self.message = ""
wh23xx.py 文件源码 项目:weewx-wh23xx 作者: matthewwall 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def loginf(msg):
    logmsg(syslog.LOG_INFO, msg)
test_handler.py 文件源码 项目:python-logbook-systemd 作者: vivienm 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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)


问题


面经


文章

微信
公众号

扫码关注公众号