]> kaliko git repositories - sid.git/commitdiff
Use namespace to init loggers
authorkaliko <kaliko@azylum.org>
Tue, 5 May 2015 16:35:25 +0000 (18:35 +0200)
committerkaliko <kaliko@azylum.org>
Tue, 5 May 2015 16:35:25 +0000 (18:35 +0200)
Thanks Link Mauve for pointing it out

sid/plugin.py
sid/sid.py

index 447e7033647ba6ffe5dc1e89f9f47488f4b1d05e..3e7c87e63714e57e4bd9775b249239dea9a8a2d3 100644 (file)
@@ -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
index 1f8cd07d32331b7135f895459bfa1c9a72382ca0..82dcab560d3ee1810e1b21bd32d32c184f053804 100644 (file)
@@ -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