mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-17 23:52:46 +01:00
Made setting supybot.log.minimumPriority set the actual level being logged.
This commit is contained in:
parent
9997042575
commit
fe23675caa
13
src/Admin.py
13
src/Admin.py
@ -361,19 +361,6 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
||||
irc.replySuccess()
|
||||
reportbug = privmsgs.thread(reportbug)
|
||||
|
||||
def loglevel(self, irc, msg, args):
|
||||
"""{DEBUG,INFO,WARNING,ERROR,CRITICAL}
|
||||
|
||||
Sets the logging level of the bot's logs.
|
||||
"""
|
||||
level = privmsgs.getArgs(args)
|
||||
try:
|
||||
level = getattr(logging, level.upper())
|
||||
except AttributeError:
|
||||
raise callbacks.ArgumentError
|
||||
log.setLevel(level)
|
||||
irc.replySuccess()
|
||||
|
||||
|
||||
Class = Admin
|
||||
|
||||
|
@ -50,6 +50,7 @@ class LogLevel(registry.Value):
|
||||
s = s.upper()
|
||||
try:
|
||||
self.value = getattr(logging, s)
|
||||
_logger.setLevel(self.value) # _logger defined later.
|
||||
except AttributeError:
|
||||
s = 'Invalid log level: should be one of ' \
|
||||
'DEBUG, INFO, WARNING, ERROR, or CRITICAL.'
|
||||
@ -224,7 +225,7 @@ def getPluginLogger(name):
|
||||
if not log.handlers:
|
||||
filename = os.path.join(pluginLogDir, '%s.log' % name)
|
||||
handler = BetterFileHandler(filename)
|
||||
handler.setLevel(conf.supybot.log.minimumPriority())
|
||||
handler.setLevel(-1)
|
||||
handler.setFormatter(pluginFormatter)
|
||||
log.addHandler(handler)
|
||||
return log
|
||||
|
Loading…
Reference in New Issue
Block a user