Fixed some style issues with logging calls.

This commit is contained in:
Jeremy Fincher 2005-05-18 04:18:35 +00:00
parent a1e707caa2
commit 0b848199b5
9 changed files with 24 additions and 26 deletions

View File

@ -285,9 +285,9 @@ class Channel(callbacks.Plugin):
capability = ircdb.makeChannelCapability(channel, 'op')
def makeBanmask(bannedHostmask, options):
(nick, user, host) = ircutils.splitHostmask(bannedHostmask)
self.log.debug('*** nick: %s' % nick)
self.log.debug('*** user: %s' % user)
self.log.debug('*** host: %s' % host)
self.log.debug('*** nick: %s', nick)
self.log.debug('*** user: %s', user)
self.log.debug('*** host: %s', host)
bnick = '*'
buser = '*'
bhost = '*'

View File

@ -92,18 +92,18 @@ class Ctcp(callbacks.PluginRegexp):
def ctcpTime(self, irc, msg, match):
"\x01TIME\x01"
self.log.info('Received CTCP TIME from %s' % msg.prefix)
self.log.info('Received CTCP TIME from %s', msg.prefix)
self._reply(irc, msg, 'TIME %s' % time.ctime())
def ctcpFinger(self, irc, msg, match):
"\x01FINGER\x01"
self.log.info('Received CTCP FINGER from %s' % msg.prefix)
self.log.info('Received CTCP FINGER from %s', msg.prefix)
self._reply(irc, msg,
'FINGER Supybot, the best Python IRC bot in existence!')
def ctcpSource(self, irc, msg, match):
"\x01SOURCE\x01"
self.log.info('Received CTCP SOURCE from %s' % msg.prefix)
self.log.info('Received CTCP SOURCE from %s', msg.prefix)
self._reply(irc, msg,
'SOURCE http://www.sourceforge.net/projects/supybot/')

View File

@ -87,7 +87,7 @@ class Misc(callbacks.Plugin):
if tokens:
# echo [] will get us an empty token set, but there's no need
# to log this in that case anyway, it being a nested command.
self.log.info('Not replying to %s, not a command.' % tokens[0])
self.log.info('Not replying to %s, not a command.', tokens[0])
if irc.nested:
bracketConfig = conf.supybot.commands.nested.brackets
brackets = conf.get(bracketConfig, channel)

View File

@ -512,7 +512,7 @@ class MoobotFactoids(callbacks.Plugin):
def _lock(self, irc, msg, channel, user, key, locking=True):
#self.log.debug('in _lock')
#self.log.debug('id: %s' % id)
#self.log.debug('id: %s', id)
id = user.id
info = self.db.getFactinfo(channel, key)
if not info:
@ -527,8 +527,8 @@ class MoobotFactoids(callbacks.Plugin):
irc.error(format('Factoid %q is not locked.', key))
return
# Can only lock/unlock own factoids unless you're an admin
#self.log.debug('admin?: %s' % ircdb.checkCapability(id, 'admin'))
#self.log.debug('created_by: %s' % created_by)
#self.log.debug('admin?: %s', ircdb.checkCapability(id, 'admin'))
#self.log.debug('created_by: %s', created_by)
if not (ircdb.checkCapability(id, 'admin') or created_by == id):
if locking:
s = 'lock'

View File

@ -74,7 +74,7 @@ def numberShifts(s):
class Nickometer(callbacks.Plugin):
def punish(self, damage, reason):
self.log.debug('%s lameness points awarded: %s' % (damage, reason))
self.log.debug('%s lameness points awarded: %s', damage, reason)
return damage
def nickometer(self, irc, msg, args, nick):
@ -145,8 +145,8 @@ class Nickometer(callbacks.Plugin):
nick=re.sub('^([^[\]]*)(\[)(.*)(\])([^[\]]*)$', '\1\3\5', nick, 1)
if nick == nickInitial:
break
self.log.debug('Removed some matching brackets \'%s\' => \'%s\'' %
(nickInitial, nick));
self.log.debug('Removed some matching brackets %r => %r',
nickInitial, nick)
# ... and punish for unmatched brackets
unmatched = re.findall('[][(){}]', nick)
if len(unmatched) > 0:
@ -224,8 +224,7 @@ class Nickometer(callbacks.Plugin):
(originalNick, score_string))
self.log.debug('Calculated lameness score for %s as %s '
'(raw score was %s)' %
(originalNick, score_string, score))
'(raw score was %s)', originalNick, score_string, score)
nickometer = wrap(nickometer, [additional('text')])
Class = Nickometer

View File

@ -221,7 +221,7 @@ class Owner(callbacks.Plugin):
# letter.
if name[0].isupper() and not irc.getCallback(name):
# This is debug because each log logs its beginning.
self.log.debug('Loading %s.' % name)
self.log.debug('Loading %s.', name)
try:
m = plugin.loadPluginModule(name,
ignoreDeprecation=True)
@ -257,7 +257,7 @@ class Owner(callbacks.Plugin):
if s:
ignored = ircdb.checkIgnored(msg.prefix)
if ignored:
self.log.info('Ignoring command from %s.' % msg.prefix)
self.log.info('Ignoring command from %s.', msg.prefix)
return
try:
tokens = callbacks.tokenize(s, channel=msg.args[0])

View File

@ -78,7 +78,7 @@ class UrlSnarfThread(world.SupyThread):
try:
super(UrlSnarfThread, self).run()
except utils.web.Error, e:
log.debug('Exception in urlSnarfer: %s' % utils.exnToString(e))
log.debug('Exception in urlSnarfer: %s', utils.exnToString(e))
class SnarfQueue(ircutils.FloodQueue):
timeout = conf.supybot.snarfThrottle
@ -365,7 +365,7 @@ def getChannelDb(irc, msg, args, state, **kwargs):
channel = channelSpecific.link()
if not conf.get(channelSpecific.link.allow, channel):
log.warning('channelSpecific.link is globally set to %s, but '
'%s disallows linking to its db.' % (channel, channel))
'%s disallowed linking to its db.', channel, channel)
raise
else:
channel = channelSpecific.getChannelLink(channel)
@ -882,7 +882,7 @@ def wrap(f, specList=[], name=None, **kw):
spec = Spec(specList, **kw)
def newf(self, irc, msg, args, **kwargs):
state = spec(irc, msg, args, stateAttrs={'cb': self, 'log': self.log})
self.log.debug('State before call: %s' % state)
self.log.debug('State before call: %s', state)
try:
f(self, irc, msg, args, *state.args, **state.kwargs)
except TypeError:

View File

@ -691,7 +691,6 @@ class Irc(IrcCommandDispatcher):
s = 'Ping sent at %s not replied to.' % \
log.timestamp(self.lastping)
log.warning(s)
# Let's notify the plugins that we're reconnecting.
self.feedMsg(ircmsgs.error(s))
self.driver.reconnect()
elif not self.zombie:
@ -703,7 +702,7 @@ class Irc(IrcCommandDispatcher):
for callback in reversed(self.callbacks):
msg = callback.outFilter(self, msg)
if msg is None:
log.debug('%s.outFilter returned None.' % callback.name())
log.debug('%s.outFilter returned None.', callback.name())
return self.takeMsg()
world.debugFlush()
if len(str(msg)) > 512:
@ -785,7 +784,7 @@ class Irc(IrcCommandDispatcher):
try:
m = callback.inFilter(self, msg)
if not m:
log.debug('%s.inFilter returned None' % callback.name())
log.debug('%s.inFilter returned None', callback.name())
return
msg = m
except:
@ -959,7 +958,7 @@ class Irc(IrcCommandDispatcher):
def _reallyDie(self):
"""Makes the Irc object die. Dead."""
log.info('Irc object for %s dying.' % self.network)
log.info('Irc object for %s dying.', self.network)
# XXX This hasattr should be removed, I'm just putting it here because
# we're so close to a release. After 0.80.0 we should remove this
# and fix whatever AttributeErrors arise in the drivers themselves.

View File

@ -139,8 +139,8 @@ def upkeep():
# registry.open(registryFilename)
if not dying:
log.debug('Regexp cache size: %s', len(sre._cache))
log.debug('Pattern cache size: %s'%len(ircutils._patternCache))
log.debug('HostmaskPatternEqual cache size: %s' %
log.debug('Pattern cache size: %s', len(ircutils._patternCache))
log.debug('HostmaskPatternEqual cache size: %s',
len(ircutils._hostmaskPatternEqualCache))
#timestamp = log.timestamp()
if doFlush: