From f48f8e7eeadd31edbb3d0edca0a640325aa7cefc Mon Sep 17 00:00:00 2001 From: Dylan Schultz <9121234+dylanschultzie@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:20:06 -0800 Subject: [PATCH] Add more logging Signed-off-by: Dylan Schultz <9121234+dylanschultzie@users.noreply.github.com> --- app/cosmos/cosmos.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/cosmos/cosmos.py b/app/cosmos/cosmos.py index cefbfce..cc5bd1a 100644 --- a/app/cosmos/cosmos.py +++ b/app/cosmos/cosmos.py @@ -1,6 +1,9 @@ import requests +import logging + from datetime import datetime, timedelta, timezone +logger = logging.getLogger(__name__) def modify_host(host_rpc): host, port = host_rpc.split(":") @@ -10,9 +13,10 @@ def modify_host(host_rpc): def cosmos_health(host: str, acceptable_time_delta: int = 10) -> tuple: acceptable_time_delta = timedelta(seconds=acceptable_time_delta) - + logger.info(f"{host} | pre modification") if not host.endswith("57"): host = modify_host(host) + logger.info(f"{host} | post modification") url = f"http://{host}/status" response = requests.post(url) @@ -22,6 +26,8 @@ def cosmos_health(host: str, acceptable_time_delta: int = 10) -> tuple: latest_block_data = response.json() + logger.info(f"{host} | {latest_block_data}") + # Check sync status if "result" not in latest_block_data: return "Sync status check failed", 500