From b26c78202ba7fe5e265736e628279e1d2fec4c39 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 21 Sep 2018 10:00:21 +0200 Subject: [PATCH] Consolidate log entries about excluded materials I got a log where 80% of the log was this particular message. Let's not do that. --- cura/Machines/MaterialManager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index dd6376b5e3..b7f3978db8 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -337,6 +337,7 @@ class MaterialManager(QObject): machine_exclude_materials = machine_definition.getMetaDataEntry("exclude_materials", []) material_id_metadata_dict = dict() # type: Dict[str, MaterialNode] + excluded_materials = set() for current_node in nodes_to_check: if current_node is None: continue @@ -345,13 +346,14 @@ class MaterialManager(QObject): # Do not exclude other materials that are of the same type. for material_id, node in current_node.material_map.items(): if material_id in machine_exclude_materials: - Logger.log("d", "Exclude material [%s] for machine [%s]", - material_id, machine_definition.getId()) + excluded_materials.add(material_id) continue if material_id not in material_id_metadata_dict: material_id_metadata_dict[material_id] = node + Logger.log("d", "Exclude materials {excluded_materials} for machine {machine_definition_id}".format(excluded_materials = ", ".join(excluded_materials), machine_definition_id = machine_definition_id)) + return material_id_metadata_dict #