Added supybot.log.individualPluginLogfiles.

This commit is contained in:
Jeremy Fincher 2004-04-14 16:06:22 +00:00
parent bb850f2d6a
commit 589cdd0694
2 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,7 @@
* Added supybot.log.individualPluginLogfiles, which determines
whether plugin logs will be logged to their individual logfiles
in addition to the misc.log logfile.
* Added supybot.plugins.WordStats.ignoreQueries, which, when * Added supybot.plugins.WordStats.ignoreQueries, which, when
true, makes the bot ignore queries (and not increment its word true, makes the bot ignore queries (and not increment its word
statistics). statistics).

View File

@ -146,6 +146,8 @@ setLevel = _logger.setLevel
atexit.register(logging.shutdown) atexit.register(logging.shutdown)
def getPluginLogger(name): def getPluginLogger(name):
if not conf.supybot.log.individualPluginLogfiles():
return _logger
log = logging.getLogger('supybot.plugins.%s' % name) log = logging.getLogger('supybot.plugins.%s' % name)
if not log.handlers: if not log.handlers:
filename = os.path.join(pluginLogDir, '%s.log' % name) filename = os.path.join(pluginLogDir, '%s.log' % name)
@ -236,13 +238,14 @@ conf.supybot.directories.register('log', registry.String('logs', """Determines
what directory the bot will store its logfiles in.""")) what directory the bot will store its logfiles in."""))
conf.supybot.register('log') conf.supybot.register('log')
conf.supybot.log.register('level', LogLevel(logging.INFO, conf.supybot.log.register('level', LogLevel(logging.INFO, """Determines what
"""Determines what the minimum priority level logged will be. Valid values are the minimum priority level logged will be. Valid values are DEBUG, INFO,
DEBUG, INFO, WARNING, ERROR, and CRITICAL, in order of increasing WARNING, ERROR, and CRITICAL, in order of increasing priority."""))
priority.""")) conf.supybot.log.register('stdout', registry.Boolean(True, """Determines
conf.supybot.log.register('stdout', whether the bot will log to stdout."""))
registry.Boolean(True, """Determines whether the bot will log to conf.supybot.log.register('individualPluginLogfiles', registry.Boolean(True,
stdout.""")) """Determines whether the bot will separate plugin logs into their own
individual logfiles."""))
class BooleanRequiredFalseOnWindows(registry.Boolean): class BooleanRequiredFalseOnWindows(registry.Boolean):
def set(self, s): def set(self, s):