Debug Mode Configuration¶
Overview¶
Debug mode allows you to export detailed debugging information during the export process, including: - Raw component data (component info, CAD data, 3D model data) - Symbol and footprint data - Debug logs for each stage (fetch, process, write) - Performance timing information - Error details and stack traces
Configuration Methods¶
Method 1: Command Line Arguments (Recommended)¶
Use startup arguments to quickly enable debug mode:
Parameter Priority¶
Command line arguments take precedence over other configuration methods.
Method 2: Environment Variable (Fallback)¶
Debug mode is controlled by the EASYKICONVERTER_DEBUG_MODE environment variable.
Windows (PowerShell)¶
Temporary (Current Session Only):
Permanent (System-Wide):
# Set for current user
[System.Environment]::SetEnvironmentVariable("EASYKICONVERTER_DEBUG_MODE", "true", "User")
# Set for all users (requires administrator privileges)
[System.Environment]::SetEnvironmentVariable("EASYKICONVERTER_DEBUG_MODE", "true", "Machine")
# Set for current process only
$env:EASYKICONVERTER_DEBUG_MODE="true"
Windows (CMD):
REM Temporary
set EASYKICONVERTER_DEBUG_MODE=true
REM Permanent (requires restart)
setx EASYKICONVERTER_DEBUG_MODE "true"
Linux/macOS¶
Temporary (Current Session Only):
Permanent (Add to ~/.bashrc or ~/.zshrc):
Accepted Values¶
true,1,yes- Enable debug modefalse,0,no, or not set - Disable debug mode
Method 2: CMake Build Option¶
When building from source, you can enable debug mode symbol/footprint export:
cmake -B build -G "MinGW Makefiles" -DCMAKE_PREFIX_PATH="C:/Qt/6.10.1/mingw_64" -DENABLE_SYMBOL_FOOTPRINT_DEBUG_EXPORT=ON
This compiles the code with additional debug export capabilities.
Method 3: Configuration File (Fallback)¶
If the environment variable is not set, debug mode can be controlled via the configuration file:
- Windows: %APPDATA%\EasyKiConverter\EasyKiConverter\config.json
- Linux: ~/.config/EasyKiConverter/EasyKiConverter/config.json
- macOS: ~/Library/Application Support/EasyKiConverter/EasyKiConverter/config.json
Priority Order¶
Debug mode is enabled in the following priority order:
- Command Line Arguments (Highest Priority)
-
--debugor-dargument -
Environment Variable
-
EASYKICONVERTER_DEBUG_MODEenvironment variable -
Configuration File
-
debugModesetting in config.json -
Default Value
false(disabled)
Debug Output Location¶
When debug mode is enabled, debug information is exported to:
<Output Directory>/debug/<ComponentID>/
├── cinfo_raw.json # Raw component info
├── cad_raw.json # Raw CAD data
├── adv_raw.json # Advanced data
├── model3d_raw.obj # Raw 3D model OBJ data
├── model3d_raw.step # Raw 3D model STEP data
└── debug_info.json # Debug summary and logs
Debug Information Included¶
- Component Information: LCSC component ID, name, package, datasheet
- CAD Data: Pin details, shape definitions, layer mappings
- 3D Model Data: OBJ/STEP model files and metadata
- Timing Information: Duration for each stage (fetch, process, write)
- Error Logs: Detailed error messages and stack traces
- Validation Status: Success/failure status for each stage
Security Considerations¶
Debug mode may expose sensitive information: - Component details and specifications - Internal file structures - Performance metrics
Important: Do not enable debug mode in production environments or when sharing debug output files.
Troubleshooting¶
Debug mode not working?¶
-
Check environment variable is set:
-
Restart the application after setting the environment variable
-
Check application logs for debug mode initialization messages
Debug files not being created?¶
- Ensure the output directory has write permissions
- Check that the component export was successful
- Verify debug mode is actually enabled (check logs)
Best Practices¶
- Development: Enable debug mode during development and testing
- Production: Always disable debug mode in production
- Debugging: Enable debug mode when troubleshooting specific issues
- Performance: Disable debug mode for performance-critical operations
- Security: Never commit debug output files to version control
Examples¶
Enable Debug Mode for Testing (Windows PowerShell)¶
# Set environment variable
$env:EASYKICONVERTER_DEBUG_MODE="true"
# Run application
.\build\bin\EasyKiConverter.exe
Enable Debug Mode for Development (Linux)¶
# Add to ~/.bashrc
echo 'export EASYKICONVERTER_DEBUG_MODE=true' >> ~/.bashrc
# Reload shell
source ~/.bashrc
# Run application
./build/bin/EasyKiConverter
Disable Debug Mode¶
# Unset environment variable (Linux/macOS)
unset EASYKICONVERTER_DEBUG_MODE
# Or set to false (Windows CMD)
set EASYKICONVERTER_DEBUG_MODE=false
Related Documentation¶
- BUILD_en.md - Build instructions with debug options
- FAQ_en.md - Common questions about debug mode
- FEATURES_en.md - Debug mode feature details