MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / debug_log

Function debug_log

src/codegraphcontext/utils/debug_log.py:55–71  ·  view source on GitHub ↗

Write debug message to a file if DEBUG_LOGS is enabled

(message)

Source from the content-addressed store, hash-verified

53 return message_numeric >= configured_numeric
54
55def debug_log(message):
56 """Write debug message to a file if DEBUG_LOGS is enabled"""
57 # Check if debug logging is enabled via config
58 debug_mode = _get_config_value('DEBUG_LOGS', False)
59 if not debug_mode:
60 return
61
62 # Get debug log path from config
63 debug_file = _get_config_value('DEBUG_LOG_PATH', os.path.expanduser("~/mcp_debug.log"))
64
65 # Ensure parent directory exists
66 Path(debug_file).parent.mkdir(parents=True, exist_ok=True)
67
68 timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
69 with open(debug_file, "a") as f:
70 f.write(f"[{timestamp}] {message}\n")
71 f.flush()
72
73def info_logger(msg):
74 """Log info message if log level allows"""

Callers 15

_get_python_package_pathFunction · 0.90
_get_npm_package_pathFunction · 0.90
_get_java_package_pathFunction · 0.90
_get_c_package_pathFunction · 0.90
_get_go_package_pathFunction · 0.90
parse_fileMethod · 0.90
_parse_callsMethod · 0.90
run_scip_index_asyncFunction · 0.90
safe_walkFunction · 0.90
discover_files_to_indexFunction · 0.90

Calls 1

_get_config_valueFunction · 0.85

Tested by

no test coverage detected