Log filtering for testing.

This commit is contained in:
Jeremy Fincher 2004-09-29 18:43:44 +00:00
parent bea33e53d6
commit d147def54c

View File

@ -49,9 +49,9 @@ supybot.directories.conf: test-conf
supybot.directories.log: test-logs supybot.directories.log: test-logs
supybot.reply.whenNotCommand: True supybot.reply.whenNotCommand: True
supybot.log.stdout: False supybot.log.stdout: False
supybot.log.level: DEBUG supybot.log.level: VERBOSE
supybot.log.detailedTracebacks: False supybot.log.format: %(levelname)s %(message)s
supybot.log.individualPluginLogfiles: True supybot.log.plugins.individualLogfiles: False
supybot.throttleTime: 0 supybot.throttleTime: 0
supybot.reply.whenAddressedBy.chars: @ supybot.reply.whenAddressedBy.chars: @
supybot.protocols.irc.throttleTime: -1 supybot.protocols.irc.throttleTime: -1
@ -80,6 +80,26 @@ import unittest
import supybot.utils as utils import supybot.utils as utils
import supybot.world as world import supybot.world as world
import logging
class TestLogFilter(logging.Filter):
bads = [
'No callbacks in',
'Invalid channel database',
'Exact error',
'Invalid user dictionary',
'because of noFlush',
'Queuing NICK',
'Queuing USER',
'IgnoresDB.reload failed',
'Starting log for',
]
def filter(self, record):
for bad in self.bads:
if bad in record.msg:
return False
return True
log._logger.addFilter(TestLogFilter())
class path(str): class path(str):
"""A class to represent platform-independent paths.""" """A class to represent platform-independent paths."""
_r = re.compile(r'[\\/]') _r = re.compile(r'[\\/]')