Some better logging.

This commit is contained in:
Jeremy Fincher 2003-12-03 22:17:12 +00:00
parent bc7083506f
commit 32eaa11322

View File

@ -47,18 +47,16 @@ import threading
import log import log
import conf import conf
import ircutils
startedAt = 0.0 startedAt = time.time() # Just in case it doesn't get set later.
mainThread = threading.currentThread() mainThread = threading.currentThread()
threadsSpawned = 1 # Starts at one for the initial "thread." threadsSpawned = 1 # Starts at one for the initial "thread."
commandsProcessed = 0 commandsProcessed = 0
###
# End Global Values.
###
ircs = [] ircs = [] # A list of all the IRCs.
flushers = [] # A periodic function will flush all these. flushers = [] # A periodic function will flush all these.
@ -86,15 +84,20 @@ def upkeep(): # Function to be run on occasion to do upkeep stuff.
log.warning('Uncollectable garbage: %s', gc.garbage) log.warning('Uncollectable garbage: %s', gc.garbage)
if 'noflush' not in tempvars: if 'noflush' not in tempvars:
flush() flush()
log.verbose('Regexp cache size: %s', len(sre._cache)) log.debug('Regexp cache size: %s', len(sre._cache))
log.debug('Hostmask pattern cache size: %s' % len(ircutils._patternCache))
log.info('%s upkeep ran.', time.strftime(conf.logTimestampFormat)) log.info('%s upkeep ran.', time.strftime(conf.logTimestampFormat))
return collected return collected
def makeIrcsDie(): def makeIrcsDie():
"""Kills Ircs."""
log.info('Assassinating the Irc object council...')
for irc in ircs[:]: for irc in ircs[:]:
irc.die() irc.die()
def startDying(): def startDying():
"""Starts dying."""
log.info('Begining that long, slow walk into the night...')
global dying global dying
dying = True dying = True