X-Git-Url: http://git.kaliko.me/?p=sid.git;a=blobdiff_plain;f=sid%2Fplugin.py;fp=sid%2Fplugin.py;h=f314aca9e0bedaa58dae645bdd28346c9ff7c860;hp=dd452e5aa4e16c27cfc486800c9da93288949770;hb=a8273fcb65b081ee9ebda42a0f39f071850d8f66;hpb=6c1a29c0d63ca630a36eef61a0f38baf9f7a59a8 diff --git a/sid/plugin.py b/sid/plugin.py index dd452e5..f314aca 100644 --- a/sid/plugin.py +++ b/sid/plugin.py @@ -2,6 +2,7 @@ # SPDX-FileCopyrightText: 2010, 2011 Anaël Verrier # SPDX-FileCopyrightText: 2014, 2020, 2023 kaliko +import logging from slixmpp.exceptions import XMPPError @@ -17,12 +18,16 @@ class Plugin: :param sid.sid.MUCBot bot: bot the plugin is load from """ + #: Overriding bot log level for the plugin + log_level = None def __init__(self, bot): self.bot = bot self.log = bot.log.getChild(self.__class__.__name__) #: :py:obj:`list` : List of tuples (event, handler) self.handlers = [] + if self.log_level: + self.log.setLevel(self.log_level) def add_handlers(self): """Add handlers declared in self.hanlders"""