Skip to content

Commit da7f0ed

Browse files
committed
refactor: configure logging levels for mcp and mcp.server
1 parent 6485d12 commit da7f0ed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/common/utils/tool_code.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ def generate_mcp_server_code(self, code_str, params):
155155
return f"""
156156
import os
157157
import sys
158+
import logging
159+
logging.basicConfig(level=logging.WARNING)
160+
logging.getLogger("mcp").setLevel(logging.ERROR)
161+
logging.getLogger("mcp.server").setLevel(logging.ERROR)
162+
158163
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
159164
sys.path = [p for p in sys.path if p not in path_to_exclude]
160165
sys.path += {python_paths}

0 commit comments

Comments
 (0)