Moved the disable method closer to its call site.

This commit is contained in:
Jeremy Fincher 2006-01-12 19:17:09 +00:00
parent 4dcc4dea87
commit 6d45897278

View File

@ -90,15 +90,6 @@ class Logger(logging.Logger):
class StdoutStreamHandler(logging.StreamHandler):
def disable(self):
self.setLevel(sys.maxint) # Just in case.
_logger.removeHandler(self)
logging._acquireLock()
try:
del logging._handlers[self]
finally:
logging._releaseLock()
def format(self, record):
s = logging.StreamHandler.format(self, record)
if record.levelname != 'ERROR' and conf.supybot.log.stdout.wrap():
@ -122,6 +113,15 @@ class StdoutStreamHandler(logging.StreamHandler):
error('Error logging to stdout. Removing stdout handler.')
exception('Uncaught exception in StdoutStreamHandler:')
def disable(self):
self.setLevel(sys.maxint) # Just in case.
_logger.removeHandler(self)
logging._acquireLock()
try:
del logging._handlers[self]
finally:
logging._releaseLock()
class BetterFileHandler(logging.FileHandler):
def emit(self, record):