feat: implement timezone-aware logging system
- Fix inconsistent timestamp formats in logs for easier troubleshooting - All logging systems now respect Docker TZ environment variable (e.g., TZ=America/New_York) - Add TimezoneAwareFormatter for Python's standard logging module - Enhance _log function with robust timezone support and fallbacks - Replace placeholder logging functions with centralized core.logging._log - Support both zoneinfo (Python 3.9+) and pytz (older versions) - Users now see consistent timezone formatting across all log outputs
This commit is contained in:
@@ -11,10 +11,7 @@ from urllib.parse import urlencode, quote
|
||||
from urllib.request import Request as UrlRequest, urlopen
|
||||
from urllib.error import URLError, HTTPError
|
||||
|
||||
|
||||
def _log(level: str, msg: str):
|
||||
"""Placeholder logging function - replace with your actual logger"""
|
||||
print(f"[{datetime.now().isoformat()}] {level}: {msg}")
|
||||
from core.logging import _log
|
||||
|
||||
|
||||
def _get_json(url: str, timeout: int = 20, headers: Dict[str, str] = None) -> Optional[Dict[str, Any]]:
|
||||
|
||||
Reference in New Issue
Block a user