Skip to content

Commit 38f0030

Browse files
dhsifssxbingW
authored andcommitted
fix: log format
1 parent 850fd44 commit 38f0030

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

mcp_server/config/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ def set_log_level():
5353
case "critical":
5454
level = logging.CRITICAL
5555

56-
logging.basicConfig(level=level)
56+
logging.basicConfig(level=level, format="%(asctime)s - %(levelname)s - %(message)s")

mcp_server/server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from starlette.routing import Route, Mount
66
from starlette.requests import Request
77
import uvicorn
8-
from starlette.responses import PlainTextResponse
98
from tools import tools
109
from config import GLOBAL_CONFIG
1110
from middleware import AuthenticationMiddleware

mcp_server/utils/request.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ async def post_slce_api(path: str,req_body: dict) -> str:
1919
if not path.startswith("/"):
2020
path = f"/{path}"
2121

22-
async with AsyncClient(verify=False) as client:
23-
response = await client.post(f"{GLOBAL_CONFIG.SAFELINE_ADDRESS}{path}", json=req_body, headers={
24-
"X-SLCE-API-TOKEN": f"{GLOBAL_CONFIG.SAFELINE_API_TOKEN}"
25-
})
26-
return check_slce_response(response)
22+
try:
23+
async with AsyncClient(verify=False) as client:
24+
response = await client.post(f"{GLOBAL_CONFIG.SAFELINE_ADDRESS}{path}", json=req_body, headers={
25+
"X-SLCE-API-TOKEN": f"{GLOBAL_CONFIG.SAFELINE_API_TOKEN}"
26+
})
27+
return check_slce_response(response)
28+
except Exception as e:
29+
return str(e)

0 commit comments

Comments
 (0)