feat: replace all print statements with proper logging system
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user