From 8421d7092f019065f0260549d3d1a84da5f99c1b Mon Sep 17 00:00:00 2001 From: Anson Date: Fri, 23 May 2025 15:59:17 -0600 Subject: [PATCH] Remove testing code --- src/two_chainz/__init__.py | 22 ++-------------------- website/index.html | 3 ++- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/two_chainz/__init__.py b/src/two_chainz/__init__.py index dd81c4a..df95a2a 100644 --- a/src/two_chainz/__init__.py +++ b/src/two_chainz/__init__.py @@ -3,8 +3,8 @@ import time import tomllib from datetime import datetime from pathlib import Path -import logging -from fastapi import FastAPI, Request + +from fastapi import FastAPI from fastapi.middleware.trustedhost import TrustedHostMiddleware from fastapi.staticfiles import StaticFiles @@ -13,8 +13,6 @@ app.add_middleware( TrustedHostMiddleware, allowed_hosts=["*"], ) -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) start_time = time.time() @@ -31,22 +29,6 @@ def read_data() -> dict[str, str]: data = read_data() -# Log all requests to debug issues -@app.middleware("http") -async def log_requests(request: Request, call_next): - # Log what's coming in - logger.info(f"Request: {request.method} {request.url.path}") - logger.info(f"Host header: {request.headers.get('host')}") - logger.info(f"CF-Ray: {request.headers.get('cf-ray', 'Not from Cloudflare')}") - - try: - response = await call_next(request) - return response - except Exception as e: - logger.error(f"Request processing failed: {e}") - raise - - @app.get("/api/") async def ping(): return { diff --git a/website/index.html b/website/index.html index 534560a..3fac336 100644 --- a/website/index.html +++ b/website/index.html @@ -286,6 +286,7 @@ }); } - + +