mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +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()
|
self.close()
|
||||||
|
|
||||||
def scheduleReconnect(self):
|
def scheduleReconnect(self):
|
||||||
when = time.time() + 60
|
when = log.timestamp(time.time()+60)
|
||||||
whenS = time.strftime(conf.supybot.log.timestampFormat(),
|
|
||||||
time.localtime(when))
|
|
||||||
if not world.dying:
|
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():
|
def makeNewDriver():
|
||||||
self.irc.reset()
|
self.irc.reset()
|
||||||
driver = self.__class__(self.server, self.irc)
|
driver = self.__class__(self.server, self.irc)
|
||||||
|
@ -35,6 +35,7 @@ import fix
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import cgitb
|
import cgitb
|
||||||
import types
|
import types
|
||||||
import atexit
|
import atexit
|
||||||
@ -228,6 +229,12 @@ def getPluginLogger(name):
|
|||||||
log.addHandler(handler)
|
log.addHandler(handler)
|
||||||
return log
|
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:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
|
||||||
|
@ -152,10 +152,9 @@ class SocketDriver(drivers.IrcDriver):
|
|||||||
|
|
||||||
def _scheduleReconnect(self):
|
def _scheduleReconnect(self):
|
||||||
when = time.time() + self.reconnectWaits[self.reconnectWaitsIndex]
|
when = time.time() + self.reconnectWaits[self.reconnectWaitsIndex]
|
||||||
whenS = time.strftime(conf.supybot.log.timestampFormat(),
|
when = log.timestamp(when)
|
||||||
time.localtime(when))
|
|
||||||
if not world.dying:
|
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)
|
schedule.addEvent(self.reconnect, when)
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
|
@ -92,8 +92,7 @@ def upkeep():
|
|||||||
log.debug('Pattern cache size: %s'%len(ircutils._patternCache))
|
log.debug('Pattern cache size: %s'%len(ircutils._patternCache))
|
||||||
log.debug('HostmaskPatternEqual cache size: %s' %
|
log.debug('HostmaskPatternEqual cache size: %s' %
|
||||||
len(ircutils._hostmaskPatternEqualCache))
|
len(ircutils._hostmaskPatternEqualCache))
|
||||||
log.info('%s upkeep ran.',
|
log.info('%s upkeep ran.', log.timestamp())
|
||||||
time.strftime(conf.supybot.log.timestampFormat()))
|
|
||||||
return collected
|
return collected
|
||||||
|
|
||||||
def makeDriversDie():
|
def makeDriversDie():
|
||||||
|
Loading…
Reference in New Issue
Block a user