feat: replace all print statements with proper logging system

This commit is contained in:
Сергей Антропов
2025-08-20 17:19:49 +03:00
parent f3221d6102
commit a49714ab14
6 changed files with 96 additions and 25 deletions

View File

@@ -17,6 +17,7 @@ import docker
from app.core.auth import get_current_user
from app.core.docker import docker_client, DEFAULT_TAIL
from app.core.logger import api_logger
router = APIRouter()
@@ -64,7 +65,7 @@ def api_logs_stats(container_id: str, current_user: str = Depends(get_current_us
)
except Exception as e:
print(f"Error getting log stats for {container_id}: {e}")
api_logger.error(f"Error getting log stats for {container_id}: {e}")
return JSONResponse({"error": str(e)}, status_code=500)
@router.get("/{container_id}")
@@ -193,7 +194,7 @@ def api_logs(
)
except Exception as e:
print(f"Error getting logs for {container_id}: {e}")
api_logger.error(f"Error getting logs for {container_id}: {e}")
return JSONResponse({"error": str(e)}, status_code=500)
@router.post("/snapshot")