Skip to content

Commit 921e087

Browse files
committed
logging docs cleanup
1 parent fda329c commit 921e087

File tree

5 files changed

+10
-56
lines changed

5 files changed

+10
-56
lines changed

docs/configuration.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ These settings control how the server locates KiCad:
2929
|---------------------|-------------|---------------|---------|
3030
| `KICAD_APP_PATH` | Path to the KiCad application | `/Applications/KiCad/KiCad.app` (macOS)<br>`C:\Program Files\KiCad` (Windows)<br>`/usr/share/kicad` (Linux) | `/Applications/KiCad7/KiCad.app` |
3131

32-
### Logging Configuration
33-
34-
These settings control server logging behavior:
35-
36-
| Environment Variable | Description | Default Value | Example |
37-
|---------------------|-------------|---------------|---------|
38-
| `LOG_LEVEL` | Sets logging verbosity | `INFO` | `DEBUG`, `INFO`, `WARNING`, `ERROR` |
39-
| `LOG_DIR` | Directory for log files | `logs` | `~/.kicad_mcp/logs` |
40-
4132
## Using a .env File (Recommended)
4233

4334
The recommended way to configure the server is by creating a `.env` file in the project root:
@@ -69,10 +60,6 @@ The recommended way to configure the server is by creating a `.env` file in the
6960
# KICAD_APP_PATH=C:\Program Files\KiCad
7061
# Linux:
7162
# KICAD_APP_PATH=/usr/share/kicad
72-
73-
# Logging configuration
74-
LOG_LEVEL=INFO
75-
LOG_DIR=logs
7663
```
7764

7865
## Directory Structure and Project Discovery
@@ -147,7 +134,7 @@ You can also set environment variables directly in the client configuration:
147134
],
148135
"env": {
149136
"KICAD_SEARCH_PATHS": "/custom/path1,/custom/path2",
150-
"LOG_LEVEL": "DEBUG"
137+
"KICAD_APP_PATH": "/custom/path"
151138
}
152139
}
153140
}
@@ -222,19 +209,14 @@ KICAD_APP_PATH=/opt/kicad
222209

223210
If you're having configuration problems:
224211

225-
1. Run the server with debug logging:
226-
```bash
227-
LOG_LEVEL=DEBUG python main.py
228-
```
229-
230-
2. Check the logs for configuration-related messages:
212+
1. Run the server:
231213
```bash
232-
cat logs/kicad_mcp_*.log | grep "config"
214+
python main.py
233215
```
234216

235-
3. Verify environment variables are being loaded:
217+
2. Verify environment variables are being loaded:
236218
```bash
237219
python -c "import os; print(os.environ.get('KICAD_SEARCH_PATHS', 'Not set'))"
238220
```
239221

240-
4. Try absolute paths to eliminate path resolution issues
222+
3. Try absolute paths to eliminate path resolution issues

docs/troubleshooting.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,6 @@ To diagnose issues, check the server logs:
194194
%APPDATA%\Claude\Logs\
195195
```
196196
197-
### Enabling Debug Logging
198-
199-
For more detailed logs, set the logging level to DEBUG in your `.env` file:
200-
201-
```
202-
LOG_LEVEL=DEBUG
203-
```
204-
205197
## DRC and Export Feature Issues
206198
207199
### DRC Checks Failing

kicad_mcp/tools/export_tools.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,7 @@ async def generate_pcb_thumbnail(project_path: str, ctx: Context) -> Optional[Im
105105
await ctx.report_progress(10, 100)
106106
ctx.info(f"Generating thumbnail for {os.path.basename(pcb_file)}")
107107

108-
# Method 1: Try to use pcbnew Python module if available
109-
if kicad_modules_available:
110-
try:
111-
thumbnail = await generate_thumbnail_with_pcbnew(pcb_file, ctx)
112-
if thumbnail:
113-
# Cache the result if possible
114-
if hasattr(app_context, 'cache'):
115-
app_context.cache[cache_key] = thumbnail
116-
return thumbnail
117-
118-
# If pcbnew method failed, log it but continue to try alternative method
119-
print("Failed to generate thumbnail with pcbnew, trying CLI method")
120-
except Exception as e:
121-
print(f"Error using pcbnew for thumbnail: {str(e)}", exc_info=True)
122-
ctx.info(f"Error with pcbnew method, trying alternative approach")
123-
else:
124-
print("KiCad Python modules not available, trying CLI method")
125-
126-
# Method 2: Try to use command-line tools
108+
# Try to use command-line tools
127109
try:
128110
thumbnail = await generate_thumbnail_with_cli(pcb_file, ctx)
129111
if thumbnail:
@@ -135,7 +117,7 @@ async def generate_pcb_thumbnail(project_path: str, ctx: Context) -> Optional[Im
135117
print(f"Error using CLI for thumbnail: {str(e)}", exc_info=True)
136118
ctx.info(f"Error generating thumbnail with CLI method")
137119

138-
# If all methods fail, inform the user
120+
# If it fails, inform the user
139121
ctx.info("Could not generate thumbnail for PCB - all methods failed")
140122
return None
141123

kicad_mcp/utils/env.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
Environment variable handling for KiCad MCP Server.
33
"""
44
import os
5-
import logging
6-
from pathlib import Path
7-
from typing import Dict, Any, Optional
5+
from typing import Dict, Optional
86

97
def load_dotenv(env_file: str = ".env") -> Dict[str, str]:
108
"""Load environment variables from .env file.
@@ -54,7 +52,7 @@ def load_dotenv(env_file: str = ".env") -> Dict[str, str]:
5452
env_vars[key] = value
5553

5654
except Exception as e:
57-
logging.warning(f"Error loading .env file: {str(e)}")
55+
print(f"Error loading .env file: {str(e)}")
5856

5957
return env_vars
6058

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
try:
1818
print("Starting KiCad MCP server")
1919

20-
# Log search paths from config
20+
# Print search paths from config
2121
print(f"Using KiCad user directory: {KICAD_USER_DIR}")
2222
if ADDITIONAL_SEARCH_PATHS:
2323
print(f"Additional search paths: {', '.join(ADDITIONAL_SEARCH_PATHS)}")

0 commit comments

Comments
 (0)