Browse Source

Consolidate log entries about excluded materials

I got a log where 80% of the log was this particular message. Let's not do that.
Ghostkeeper 6 years ago
parent
commit
b26c78202b
1 changed files with 4 additions and 2 deletions
  1. 4 2
      cura/Machines/MaterialManager.py

+ 4 - 2
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
 
     #