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(): ...@@ -18,19 +18,18 @@ def getZopeVersion():
return App.version_txt.version_txt() return App.version_txt.version_txt()
def patchAsyncoreLogger(): def patchAsyncoreLogger():
# Poke zLOG default logging into asyncore to send # Poke the Python logging module into asyncore to send
# messages to zLOG instead of medusa logger # messages to logging instead of medusa logger
from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR from logging import getLogger
register_subsystem('ZServer') logger = getLogger('ZServer')
severity={'info':INFO, 'warning':WARNING, 'error': ERROR}
def log_info(self, message, type='info'): def log_info(self, message, type='info'):
if message[:14]=='adding channel' or \ if message[:14]=='adding channel' or \
message[:15]=='closing channel' or \ message[:15]=='closing channel' or \
message == 'Computing default hostname': message == 'Computing default hostname':
LOG('ZServer', BLATHER, message) logger.debug(message)
else: else:
LOG('ZServer', severity[type], message) getattr(logger, type)(message)
import asyncore import asyncore
asyncore.dispatcher.log_info=log_info 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