mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Added log.timestamp.
This commit is contained in:
parent
6950f65c98
commit
dc87ed26aa
@ -73,11 +73,9 @@ class AsyncoreDriver(asynchat.async_chat, object):
|
||||
self.close()
|
||||
|
||||
def scheduleReconnect(self):
|
||||
when = time.time() + 60
|
||||
whenS = time.strftime(conf.supybot.log.timestampFormat(),
|
||||
time.localtime(when))
|
||||
when = log.timestamp(time.time()+60)
|
||||
if not world.dying:
|
||||
log.info('Scheduling reconnect to %s at %s', self.server, whenS)
|
||||
log.info('Scheduling reconnect to %s at %s', self.server, when)
|
||||
def makeNewDriver():
|
||||
self.irc.reset()
|
||||
driver = self.__class__(self.server, self.irc)
|
||||
|
@ -35,6 +35,7 @@ import fix
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import cgitb
|
||||
import types
|
||||
import atexit
|
||||
@ -228,6 +229,12 @@ def getPluginLogger(name):
|
||||
log.addHandler(handler)
|
||||
return log
|
||||
|
||||
def timestamp(when=None):
|
||||
if when is None:
|
||||
when = time.time()
|
||||
format = conf.supybot.log.timestampFormat()
|
||||
return time.strftime(format, time.localtime(when))
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
||||
|
@ -152,10 +152,9 @@ class SocketDriver(drivers.IrcDriver):
|
||||
|
||||
def _scheduleReconnect(self):
|
||||
when = time.time() + self.reconnectWaits[self.reconnectWaitsIndex]
|
||||
whenS = time.strftime(conf.supybot.log.timestampFormat(),
|
||||
time.localtime(when))
|
||||
when = log.timestamp(when)
|
||||
if not world.dying:
|
||||
log.info('Scheduling reconnect to %s at %s', self.server, whenS)
|
||||
log.info('Scheduling reconnect to %s at %s', self.server, when)
|
||||
schedule.addEvent(self.reconnect, when)
|
||||
|
||||
def name(self):
|
||||
|
@ -92,8 +92,7 @@ def upkeep():
|
||||
log.debug('Pattern cache size: %s'%len(ircutils._patternCache))
|
||||
log.debug('HostmaskPatternEqual cache size: %s' %
|
||||
len(ircutils._hostmaskPatternEqualCache))
|
||||
log.info('%s upkeep ran.',
|
||||
time.strftime(conf.supybot.log.timestampFormat()))
|
||||
log.info('%s upkeep ran.', log.timestamp())
|
||||
return collected
|
||||
|
||||
def makeDriversDie():
|
||||
|
Loading…
Reference in New Issue
Block a user