From efde726294d04e02bb52c15ad2c9ebdb696c98cf Mon Sep 17 00:00:00 2001 From: kaliko Date: Tue, 5 May 2015 18:35:25 +0200 Subject: [PATCH] Use namespace to init loggers Thanks Link Mauve for pointing it out --- sid/plugin.py | 2 +- sid/sid.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5