Skip to content

Commit

Permalink
fix(converter): Fix serialization logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Feb 29, 2024
1 parent 327f9c8 commit 25ce3b4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions capella2polarion/converters/element_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,18 @@ def serialize(self, uuid: str) -> data_models.CapellaWorkItem | None:
converter_data.work_item = None

if converter_data.errors:
logger.error(
"Serialization of %r successful, but with warnings: \n\t %s",
log_args = (
converter_data.capella_element._short_repr_(),
"\n\t".join(converter_data.errors),
)
if converter_data.work_item is None:
logger.error("Serialization of %r failed:\n\t %s", *log_args)
else:
logger.warning(
"Serialization of %r successful, but with warnings:"
"\n\t %s",
*log_args,
)
return converter_data.work_item

# General helper functions
Expand Down

0 comments on commit 25ce3b4

Please sign in to comment.