Commit 84daf34f authored by Matias Guijarro's avatar Matias Guijarro

logtools: do not add loggers for 'session.axes', 'session.counters' and 'session.comms'

Items under those 3 nodes from the map will always have corresponding
devices under 'controllers'
parent 19897f55
......@@ -243,7 +243,7 @@ class Log:
findlog = {
self.map.G.node[node]["_logger"].name
for node in self.map.G.node
if self.map.G.node[node]["_logger"].name
if self.map.G.node[node].get("_logger")
}
registered_loggers = [logging.getLogger(obj) for obj in findlog]
filtered_loggers = [
......@@ -503,9 +503,13 @@ def map_update_loggers(G):
"""
for node in list(G):
reference = G.node[node].get("instance")
inst = (
reference if isinstance(reference, str) else reference()
) # gets the instance
if isinstance(reference, str):
if reference in ("axes", "counters"):
continue
else:
inst = reference
else:
inst = reference()
if inst: # if weakref is still alive
logger_name = create_logger_name(G, node) # get proper name
......
......@@ -68,7 +68,7 @@ class MappedController(NotMappedController, LogMixin):
def test_bare_system(params):
all_loggers = logging.getLogger().manager.loggerDict
names = ["session", "session.devices", "session.counters", "session.comms"]
names = ["session", "session.controllers"]
for name in names:
assert name in all_loggers.keys()
......
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