feat(src/utils): replace printwith logger.error for consistent error logging

Use logger.error across utils to centralize error handling and allow configurable logging levels.
This commit is contained in:
sankalp committed 2026-06-17 05:21:19 +05:45
1 parent 1aed6ea816
commit 420688e9a7
4 files changed
+15 -12

No files matched your search

+3 -2
View File
@@ -1,3 +1,4 @@
from fabric.utils import logger
import threading
import time
from concurrent.futures import ThreadPoolExecutor
@@ -99,7 +100,7 @@ class CurrencyCache:
"timestamp": current_time,
}
except Exception as je:
print(f"Failed to parse JSON for {from_code}: {je}")
logger.error(f"Failed to parse JSON for {from_code}: {je}")
else:
print(
f"Background fetch for {from_code} returned status {
@@ -108,7 +109,7 @@ class CurrencyCache:
)
except Exception as e:
print(f"Background currency fetch failed for {from_code}: {e}")
logger.error(f"Background currency fetch failed for {from_code}: {e}")
finally:
# Mark request as complete
with self._cache_lock: