Skip to content

Commit

Permalink
WIP: Add debug logging [DO NOT MERGE]
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinfang committed Feb 6, 2025
1 parent e067c61 commit 4db0cf4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ def make_fanned_out_messages(message: NextVisitModel,
case _:
raise UnsupportedMessageError(f"No matching case for HSC salIndex {message.salIndex}")
case instrument if instrument in instruments:
logging.info(f"make_fanned_out_messages for {instrument}.")
gauges[instrument].total_received.inc()
logging.info(f"make_fanned_out_messages for {instrument}.")
return fan_out(message, instruments[instrument])
case _:
raise UnsupportedMessageError(f"no matching case for instrument {message.instrument}.")
Expand Down Expand Up @@ -357,6 +359,7 @@ def dispatch_fanned_out_messages(client: httpx.AsyncClient,
"source": topic,
}

logging.info(f"Will send fan out messages")
for fan_out_message in send_info.fan_out_messages:
data = fan_out_message
data_json = json.dumps(data)
Expand Down Expand Up @@ -524,6 +527,7 @@ async def main() -> None:
next_visit_message_updated = NextVisitModel.from_raw_message(
next_visit_message_initial["message"]
)
logging.info(f"updated message {next_visit_message_updated}")
send_info = make_fanned_out_messages(next_visit_message_updated,
instruments,
gauges,
Expand Down

0 comments on commit 4db0cf4

Please sign in to comment.