From: kaliko Date: Tue, 5 May 2015 16:35:25 +0000 (+0200) Subject: Use namespace to init loggers X-Git-Tag: 0.1.0~36 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=efde726294d04e02bb52c15ad2c9ebdb696c98cf;p=sid.git Use namespace to init loggers Thanks Link Mauve for pointing it out --- diff --git a/sid/plugin.py b/sid/plugin.py index 447e703..3e7c87e 100644 --- a/sid/plugin.py +++ b/sid/plugin.py @@ -25,7 +25,7 @@ class Plugin: def __init__(self, bot): self.bot = bot - self.log = bot.log + self.log = bot.log.getChild(self.__class__.__name__) def send(self, dest, msg, mtype='chat'): """Send msg to dest diff --git a/sid/sid.py b/sid/sid.py index 1f8cd07..82dcab5 100644 --- a/sid/sid.py +++ b/sid/sid.py @@ -49,7 +49,7 @@ class MUCBot(sleekxmpp.ClientXMPP): log_level=logging.INFO): super(MUCBot, self).__init__(jid, password) - self.log = logging.getLogger(__name__) + self.log = logging.getLogger(__package__) self.plugins = list() self.commands = dict() self.room = room