MCPcopy Create free account
hub / github.com/IBM/mcp-cli / configure_mcp_server_logging

Function configure_mcp_server_logging

src/mcp_cli/config/logging.py:231–253  ·  view source on GitHub ↗

Configure logging for chuk framework components. Args: suppress: If True, suppress INFO/DEBUG logs. If False, allow all.

(suppress: bool = True)

Source from the content-addressed store, hash-verified

229
230
231def configure_mcp_server_logging(suppress: bool = True) -> None:
232 """
233 Configure logging for chuk framework components.
234
235 Args:
236 suppress: If True, suppress INFO/DEBUG logs. If False, allow all.
237 """
238 # Generic chuk framework loggers
239 framework_loggers = [
240 "chuk_mcp_runtime",
241 "chuk_sessions",
242 "chuk_artifacts",
243 ]
244
245 target_level = logging.CRITICAL if suppress else logging.INFO
246
247 for logger_name in framework_loggers:
248 logger = logging.getLogger(logger_name)
249 logger.setLevel(target_level)
250 if suppress:
251 logger.propagate = False
252 if not logger.handlers:
253 logger.addHandler(logging.NullHandler())
254
255
256def setup_silent_mcp_environment() -> None:

Calls

no outgoing calls