mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Added supybot.log.individualPluginLogfiles.
This commit is contained in:
parent
bb850f2d6a
commit
589cdd0694
@ -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
|
||||
true, makes the bot ignore queries (and not increment its word
|
||||
statistics).
|
||||
|
17
src/log.py
17
src/log.py
@ -146,6 +146,8 @@ setLevel = _logger.setLevel
|
||||
atexit.register(logging.shutdown)
|
||||
|
||||
def getPluginLogger(name):
|
||||
if not conf.supybot.log.individualPluginLogfiles():
|
||||
return _logger
|
||||
log = logging.getLogger('supybot.plugins.%s' % name)
|
||||
if not log.handlers:
|
||||
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."""))
|
||||
|
||||
conf.supybot.register('log')
|
||||
conf.supybot.log.register('level', LogLevel(logging.INFO,
|
||||
"""Determines what the minimum priority level logged will be. Valid values are
|
||||
DEBUG, INFO, WARNING, ERROR, and CRITICAL, in order of increasing
|
||||
priority."""))
|
||||
conf.supybot.log.register('stdout',
|
||||
registry.Boolean(True, """Determines whether the bot will log to
|
||||
stdout."""))
|
||||
conf.supybot.log.register('level', LogLevel(logging.INFO, """Determines what
|
||||
the minimum priority level logged will be. Valid values are DEBUG, INFO,
|
||||
WARNING, ERROR, and CRITICAL, in order of increasing priority."""))
|
||||
conf.supybot.log.register('stdout', registry.Boolean(True, """Determines
|
||||
whether the bot will log to stdout."""))
|
||||
conf.supybot.log.register('individualPluginLogfiles', registry.Boolean(True,
|
||||
"""Determines whether the bot will separate plugin logs into their own
|
||||
individual logfiles."""))
|
||||
|
||||
class BooleanRequiredFalseOnWindows(registry.Boolean):
|
||||
def set(self, s):
|
||||
|
Loading…
Reference in New Issue
Block a user