Skip to content

Commit d4c3dcc

Browse files
committed
feat(converter): new log_cisu_to_rs_converted_messages_ids method
1 parent b851b51 commit d4c3dcc

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

converter/converter/cisu/resources_info/resources_info_cisu_helper.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,26 @@ def enrich_rs_ri_with_rs_srs(
9797
def get_latest_state(states: list[dict]) -> dict:
9898
"""Return the state with the most recent datetime from a list of states."""
9999
return sorted(states, key=lambda x: x.get("datetime", ""))[-1]
100+
101+
102+
def log_cisu_to_rs_converted_messages_ids(
103+
original_message: dict, rs_ri: dict | None, rs_sr_list: list[dict]
104+
) -> None:
105+
original_message_chunk = f"Converted RC-RI with distributionID {original_message.get('distributionID')} into RS-RI"
106+
107+
rs_ri_chunk = (
108+
f"into RS-RI {rs_ri.get('distributionID')}" if rs_ri is not None else ""
109+
)
110+
111+
rs_sr_distribution_id_list = (
112+
f"and {len(rs_sr_list)} RS-SR(s) "
113+
f"{[rs_sr.get('distributionID') for rs_sr in rs_sr_list]}"
114+
)
115+
116+
logger.info(
117+
" ".join(
118+
filter(
119+
None, [original_message_chunk, rs_ri_chunk, rs_sr_distribution_id_list]
120+
)
121+
)
122+
)

0 commit comments

Comments
 (0)