mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-12 05:02:33 +01:00
Merge branch 'master' into devel
This commit is contained in:
commit
0c50091d11
13
classes.py
13
classes.py
@ -93,20 +93,27 @@ class PyLinkNetworkCore(structures.DeprecatedAttributesObject, structures.CamelC
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
channels = conf.conf['logging']['channels'][self.name]
|
channels = conf.conf['logging']['channels'][self.name]
|
||||||
except KeyError: # Not set up; just ignore.
|
except (KeyError, TypeError): # Not set up; just ignore.
|
||||||
return
|
return
|
||||||
|
|
||||||
log.debug('(%s) Setting up channel logging to channels %r', self.name,
|
log.debug('(%s) Setting up channel logging to channels %r', self.name,
|
||||||
channels)
|
channels)
|
||||||
|
|
||||||
|
# Only create handlers if they haven't already been set up.
|
||||||
if not self.loghandlers:
|
if not self.loghandlers:
|
||||||
# Only create handlers if they haven't already been set up.
|
if not isinstance(channels, dict):
|
||||||
|
log.warning('(%s) Got invalid channel logging configuration %r; are your indentation '
|
||||||
|
'and block commenting consistent?', self.name, channels)
|
||||||
|
return
|
||||||
|
|
||||||
for channel, chandata in channels.items():
|
for channel, chandata in channels.items():
|
||||||
# Fetch the log level for this channel block.
|
# Fetch the log level for this channel block.
|
||||||
level = None
|
level = None
|
||||||
if chandata is not None:
|
if isinstance(chandata, dict):
|
||||||
level = chandata.get('loglevel')
|
level = chandata.get('loglevel')
|
||||||
|
else:
|
||||||
|
log.warning('(%s) Got invalid channel logging pair %r: %r; are your indentation '
|
||||||
|
'and block commenting consistent?', self.name, filename, config)
|
||||||
|
|
||||||
handler = PyLinkChannelLogger(self, channel, level=level)
|
handler = PyLinkChannelLogger(self, channel, level=level)
|
||||||
self.loghandlers.append(handler)
|
self.loghandlers.append(handler)
|
||||||
|
6
log.py
6
log.py
@ -87,7 +87,11 @@ def stopFileLoggers():
|
|||||||
files = conf.conf['logging'].get('files')
|
files = conf.conf['logging'].get('files')
|
||||||
if files:
|
if files:
|
||||||
for filename, config in files.items():
|
for filename, config in files.items():
|
||||||
makeFileLogger(filename, config.get('loglevel'))
|
if isinstance(config, dict):
|
||||||
|
makeFileLogger(filename, config.get('loglevel'))
|
||||||
|
else:
|
||||||
|
log.warning('Got invalid file logging pair %r: %r; are your indentation and block '
|
||||||
|
'commenting consistent?', filename, config)
|
||||||
|
|
||||||
log.debug("log: Emptying _log_queue")
|
log.debug("log: Emptying _log_queue")
|
||||||
# Process and empty the log queue
|
# Process and empty the log queue
|
||||||
|
Loading…
Reference in New Issue
Block a user