]> kaliko git repositories - sid.git/blobdiff - sid/echo.py
Better use of logging
[sid.git] / sid / echo.py
index f0e05b8e9d35cfedd93ff3fc72c0233b4447b28d..94836d0b4c4766cb0ebc33015676ddcb66c7f188 100644 (file)
@@ -31,7 +31,7 @@ class Echo(Plugin):
         bot.add_event_handler("muc::%s::presence" %    self.bot.room, self.log_presence)
 
     def log_presence(self, pres):
-        self.log.debug('{0}: {1}'.format(pres['muc']['nick'], pres['type']))
+        self.log.debug('%s: %s', pres['muc']['nick'], pres['type'])
         nick = pres['muc']['nick']
         self.presence.update({nick: (pres['muc']['role'], pres['type'])})
         self.log.debug(self.presence)
@@ -72,7 +72,7 @@ class Echo(Plugin):
         sender = message['from'].resource
         recipient = message['body'].split()[1]
         tell_msg = ' '.join(message['body'].split()[2:])
-        self.log.debug('{0}: {1}'.format(recipient, tell_msg))
+        self.log.debug('%s: %s', recipient, tell_msg)
         letter = '{0}, {1} wanted you to know: {2}'.format(recipient, sender, tell_msg)
         if (self.presence.get(recipient) and
                 self.presence[recipient][1] == 'available'):