Skip to content

Commit ec22fef

Browse files
Sallvainianclaude
andcommitted
Add runtime logging to verify integrated PR features
Added logging to confirm all integrated features work at runtime: - PR winfunc#261 (Mermaid): Track cache hits and render success - PR winfunc#222 (MCP Async): Track sidecar vs regular execution - PR winfunc#346 (NVM PATH): Track Node.js PATH additions All logs prefixed with PR numbers for easy identification. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 9f1435e commit ec22fef

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src-tauri/src/claude_binary.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,8 @@ pub fn create_command_with_env(program: &str) -> Command {
691691
if node_bin_path.exists() {
692692
let node_bin_str = node_bin_path.to_string_lossy();
693693
let new_path = format!("{}:{}", node_bin_str, current_path);
694-
debug!("Adding NVM Node.js to PATH for Claude execution: {}", node_bin_str);
694+
info!("[PR #346 NVM PATH] ✅ Adding NVM Node.js v{} to PATH for Claude execution", latest_version);
695+
debug!("Full NVM path added: {}", node_bin_str);
695696
cmd.env("PATH", new_path);
696697
}
697698
}

src-tauri/src/commands/mcp.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ async fn execute_claude_mcp_command(app_handle: &AppHandle, args: Vec<&str>) ->
106106
// Use Tauri sidecar API
107107
use tauri_plugin_shell::ShellExt;
108108

109+
info!("[PR #222 MCP Async] ✅ Using async sidecar execution for MCP command");
110+
109111
// Create sidecar command
110112
let mut sidecar_cmd = app_handle
111113
.shell()
@@ -118,7 +120,7 @@ async fn execute_claude_mcp_command(app_handle: &AppHandle, args: Vec<&str>) ->
118120
sidecar_cmd = sidecar_cmd.arg(arg);
119121
}
120122

121-
info!("Executing sidecar command");
123+
info!("Executing sidecar command with async/await");
122124

123125
// Execute the command
124126
let output = sidecar_cmd
@@ -134,6 +136,8 @@ async fn execute_claude_mcp_command(app_handle: &AppHandle, args: Vec<&str>) ->
134136
}
135137
} else {
136138
// Use regular command execution
139+
info!("[PR #222 MCP Async] ✅ Using regular command execution (path: {})", claude_path);
140+
137141
let mut cmd = create_command_with_env(&claude_path);
138142
cmd.arg("mcp");
139143
for arg in args {

src/components/MermaidRenderer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ const MermaidRenderer: React.FC<MermaidRendererProps> = ({ chart, id, showContro
261261
// If we have a cached result, set it immediately
262262
useEffect(() => {
263263
if (hasCachedResult && !hasInitializedRef.current && cachedEntry) {
264+
console.log('[PR #261 Mermaid] ✅ Early cache hit for chart:', chartId.substring(0, 8));
264265
setSvg(cachedEntry.svg);
265266
setError(null);
266267
hasInitializedRef.current = true;
267268
}
268-
}, [cacheKey, hasCachedResult, cachedEntry]);
269+
}, [cacheKey, hasCachedResult, cachedEntry, chartId]);
269270

270271
// Render chart immediately when component mounts (for dialog usage)
271272
useEffect(() => {
@@ -279,6 +280,7 @@ const MermaidRenderer: React.FC<MermaidRendererProps> = ({ chart, id, showContro
279280
// Check cache first
280281
const cachedEntry = chartCache.get(cacheKey);
281282
if (cachedEntry && (Date.now() - cachedEntry.timestamp < CACHE_EXPIRY_MS)) {
283+
console.log('[PR #261 Mermaid] ✅ Cache hit for chart:', chartId.substring(0, 8));
282284
setSvg(cachedEntry.svg);
283285
setError(null);
284286
hasInitializedRef.current = true;
@@ -309,6 +311,7 @@ const MermaidRenderer: React.FC<MermaidRendererProps> = ({ chart, id, showContro
309311
if (currentRequest === renderRequestRef.current) {
310312
// Cache the result with timestamp
311313
chartCache.set(cacheKey, { svg: renderedSvg, timestamp: Date.now() });
314+
console.log('[PR #261 Mermaid] ✅ Successfully rendered chart:', chartId.substring(0, 8), `(${Math.round(renderedSvg.length / 1024)}KB)`);
312315
setSvg(renderedSvg);
313316
hasInitializedRef.current = true;
314317
}

0 commit comments

Comments
 (0)