LogToIrc: Honor the configured log level

This commit is contained in:
Valentin Lorentz 2021-09-13 19:01:46 +02:00
parent 76bd1c89bf
commit 070090ffc5
2 changed files with 8 additions and 0 deletions

View File

@ -51,7 +51,9 @@ __contributors__ = {}
from . import config
from . import plugin
from . import handler
from importlib import reload
importlib.reload(handler) # In case we're being reloaded.
importlib.reload(plugin) # In case we're being reloaded.
if world.testing:

View File

@ -73,6 +73,12 @@ class IrcHandler(logging.Handler):
if networks and irc.network not in networks:
continue
msgOk = True
level = config.level.getSpecific(
network=network, channel=target)()
if level > record.levelno:
msgOk = False
if target in irc.state.channels:
channel = irc.state.channels[target]
modes = config.channelModesRequired.getSpecific(