X-Git-Url: http://git.kaliko.me/?a=blobdiff_plain;f=sid%2Fplugin.py;h=f314aca9e0bedaa58dae645bdd28346c9ff7c860;hb=95c99b21c39e37d0f3ca2715642b28af990c379a;hp=3844761c88001fae56bb0f532bcd3e7f021df4b7;hpb=a483ffa7bd75cdbf6680b2bd14e632a0d7ba6fd8;p=sid.git diff --git a/sid/plugin.py b/sid/plugin.py index 3844761..f314aca 100644 --- a/sid/plugin.py +++ b/sid/plugin.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- # SPDX-FileCopyrightText: 2010, 2011 Anaël Verrier -# SPDX-FileCopyrightText: 2014, 2020 kaliko +# SPDX-FileCopyrightText: 2014, 2020, 2023 kaliko + +import logging from slixmpp.exceptions import XMPPError @@ -16,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"""