Skip to content

Commit

Permalink
Added debug logging to render
Browse files Browse the repository at this point in the history
  • Loading branch information
Semprini committed Jul 10, 2024
1 parent 2937b38 commit 8ef4a3c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mdg/generate/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def output_level_enum(source_template: Template, dest_file_template: Template, f
fh.write(source_template.render(enum=enum))

logger.debug(f"Created {dest_filename}")
else:
logger.debug(f"Filtered out generation of {enum.name}")


def output_level_class(source_template: Template, dest_file_template: Template, filter_template: Optional[Template], package: UMLPackage) -> None:
Expand All @@ -92,6 +94,8 @@ def output_level_class(source_template: Template, dest_file_template: Template,
fh.write(source_template.render(cls=cls))

logger.debug(f"Created {dest_filename}")
else:
logger.debug(f"Filtered out generation of {cls.name}")


def output_level_assoc(source_template: Template, dest_file_template: Template, filter_template: Optional[Template], package: UMLPackage):
Expand All @@ -112,6 +116,8 @@ def output_level_assoc(source_template: Template, dest_file_template: Template,
fh.write(source_template.render(association=assoc))

logger.debug(f"Created {dest_filename}")
else:
logger.debug(f"Filtered out generation of {assoc}")


def output_model(package: UMLPackage) -> None:
Expand Down Expand Up @@ -162,6 +168,8 @@ def output_model(package: UMLPackage) -> None:
if template_definition['level'] == 'package':
if filter_template is None or filter_template.render(package=package) == "True":
output_level_package(source_template, dest_file_template, package)
else:
logger.debug(f"Filtered out generation of {package.name}")
elif template_definition['level'] == 'class':
output_level_class(source_template, dest_file_template, filter_template, package)
elif template_definition['level'] == 'enumeration':
Expand Down

0 comments on commit 8ef4a3c

Please sign in to comment.