Commit daba9890 authored by Stefan H. Holek's avatar Stefan H. Holek

Replaced zLOG with logging to shut up a deprecation warning.

parent d587406e
......@@ -18,19 +18,18 @@ def getZopeVersion():
return App.version_txt.version_txt()
def patchAsyncoreLogger():
# Poke zLOG default logging into asyncore to send
# messages to zLOG instead of medusa logger
from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
register_subsystem('ZServer')
severity={'info':INFO, 'warning':WARNING, 'error': ERROR}
# Poke the Python logging module into asyncore to send
# messages to logging instead of medusa logger
from logging import getLogger
logger = getLogger('ZServer')
def log_info(self, message, type='info'):
if message[:14]=='adding channel' or \
message[:15]=='closing channel' or \
message == 'Computing default hostname':
LOG('ZServer', BLATHER, message)
logger.debug(message)
else:
LOG('ZServer', severity[type], message)
getattr(logger, type)(message)
import asyncore
asyncore.dispatcher.log_info=log_info
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment