🔧 fix(endpoints.py): refactor logger.debug statement to improve readability and provide more information

🔧 fix(base.py): remove redundant logger.debug statement
🔧 fix(directory_reader.py): refactor logger.debug statement to improve readability and provide more information
🔧 fix(types.py): refactor logger.debug statement to improve readability and provide more information
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-22 11:38:24 -03:00
commit 44ce4eac5c
4 changed files with 7 additions and 4 deletions

View file

@ -56,7 +56,9 @@ def get_all():
logger.info(f"Loading {len(custom_component_dicts)} category(ies)") logger.info(f"Loading {len(custom_component_dicts)} category(ies)")
for custom_component_dict in custom_component_dicts: for custom_component_dict in custom_component_dicts:
logger.debug(custom_component_dict) logger.debug(
{key: len(value) for key, value in custom_component_dict.items()}
)
custom_components_from_file = merge_nested_dicts_with_renaming( custom_components_from_file = merge_nested_dicts_with_renaming(
custom_components_from_file, custom_component_dict custom_components_from_file, custom_component_dict
) )

View file

@ -40,7 +40,6 @@ class Edge:
if no_matched_type: if no_matched_type:
logger.debug(self.source_types) logger.debug(self.source_types)
logger.debug(self.target_reqs) logger.debug(self.target_reqs)
if no_matched_type:
raise ValueError( raise ValueError(
f"Edge between {self.source.vertex_type} and {self.target.vertex_type} " f"Edge between {self.source.vertex_type} and {self.target.vertex_type} "
f"has no matched type" f"has no matched type"

View file

@ -77,7 +77,7 @@ class DirectoryReader:
] ]
filtered = [menu for menu in items if menu["components"]] filtered = [menu for menu in items if menu["components"]]
logger.debug( logger.debug(
f'Filtered components {"with errors" if with_errors else ""}: {filtered}' f'Filtered components {"with errors" if with_errors else ""}: {len(filtered)}'
) )
return {"menu": filtered} return {"menu": filtered}

View file

@ -337,7 +337,9 @@ def build_valid_menu(valid_components):
valid_menu[menu_name] = {} valid_menu[menu_name] = {}
for component in menu_item["components"]: for component in menu_item["components"]:
logger.debug(f"Building component: {component}") logger.debug(
f"Building component: {component.get('name'), component.get('output_types')}"
)
try: try:
component_name = component["name"] component_name = component["name"]
component_code = component["code"] component_code = component["code"]