Replace root logger calls with module-specific loggers

This commit is contained in:
Ian Renton
2026-08-15 08:35:06 +01:00
parent 74bcd9cded
commit dd89ff4af7
64 changed files with 328 additions and 216 deletions
+5 -3
View File
@@ -13,6 +13,8 @@ from core.prometheus_metrics_handler import api_requests_counter
from core.utils import safe_json_dumps
from data.lookup_credentials import extract_credentials
logger = logging.getLogger(__name__)
class APISpotsHandler(tornado.web.RequestHandler):
"""API request handler for /api/v2/spots"""
@@ -63,7 +65,7 @@ class APISpotsHandler(tornado.web.RequestHandler):
self.write(safe_json_dumps(f"Bad request - {e!s}"))
self.set_status(400)
except Exception:
logging.exception("Excedption when handling client request to spots API")
logger.exception("Excedption when handling client request to spots API")
self.write(safe_json_dumps("Error - an internal server error occurred."))
self.set_status(500)
self.set_header("Cache-Control", "no-store")
@@ -112,7 +114,7 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
self._sse_spot_broadcaster.register(self)
except Exception:
logging.exception("Exception when serving SSE socket")
logger.exception("Exception when serving SSE socket")
self.close()
def close(self):
@@ -132,7 +134,7 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
spot.infer_missing(self._credentials)
self.write_message(msg=safe_json_dumps(spot))
except Exception:
logging.exception("Exception in SSE callback, connection will be closed")
logger.exception("Exception in SSE callback, connection will be closed")
self.close()