Skip to content

Commit 595fb75

Browse files
feat:resolved bool_variable issue.
1 parent 164c2fd commit 595fb75

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/codegraphcontext/tools/graph_builder.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,8 @@ def parse_file(self, repo_path: Path, file_path: Path, is_dependency: bool = Fal
571571
else:
572572
file_data = parser.parse(file_path, is_dependency)
573573
file_data['repo_path'] = str(repo_path)
574-
if debug_mode:
575-
debug_log(f"[parse_file] Successfully parsed: {file_path}")
576-
return file_data
574+
debug_log(f"[parse_file] Successfully parsed: {file_path}")
575+
577576
except Exception as e:
578577
logger.error(f"Error parsing {file_path} with {parser.language_name} parser: {e}")
579578
debug_log(f"[parse_file] Error parsing {file_path}: {e}")

src/codegraphcontext/utils/debug_log.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import os
22
from datetime import datetime
33

4+
# Toggle this to True to enable debug logging
5+
debug_mode = False # Set to True for dev/test, False for production
6+
47
def debug_log(message):
5-
"""Write debug message to a file"""
8+
"""Write debug message to a file if debug_mode is enabled"""
9+
if not debug_mode:
10+
return
611
debug_file = os.path.expanduser("~/mcp_debug.log")
712
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
813
with open(debug_file, "a") as f:

0 commit comments

Comments
 (0)