# Gramps Logging and Media Import Debugging This directory contains scripts to help debug media import issues in Gramps. ## Scripts ### 1. `check_gramps_logs.sh` Checks for existing Gramps log files and displays media-related errors and messages. **Usage:** ```bash ./check_gramps_logs.sh ``` This script will: - Check for log files in the snap directory - Display media-related errors and warnings - Show recent log entries - Check alternative log file locations ### 2. `run_gramps_with_logging.sh` Runs Gramps with debug logging enabled and monitors the log file in real-time. **Usage:** ```bash ./run_gramps_with_logging.sh ``` This script will: - Start Gramps with debug logging for media and import operations - Monitor the log file as it's created - Display log entries in real-time ## How to Debug Media Import Issues 1. **Run Gramps with logging:** ```bash ./run_gramps_with_logging.sh ``` 2. **In Gramps:** - Import the `demo_family.gramps` file - Note any error messages in the Gramps UI - Close Gramps when done 3. **Check the logs:** ```bash ./check_gramps_logs.sh ``` 4. **Look for:** - Media file path errors - Import errors - File not found messages - Permission errors ## Manual Log File Location For Gramps installed via snap, log files are located at: ``` ~/snap/gramps/11/.config/gramps/gramps60/logs/Gramps60.log ``` ## Common Issues ### Media files not found - Check that the `portraits/` directory is in the same directory as `demo_family.gramps` - Verify file paths in the XML are relative (e.g., `portraits/portrait_0001_John_Smith.svg`) - Set the base media path in Gramps: Edit → Preferences → Family Tree → Base media path ### Import errors - Check the log file for specific error messages - Verify XML structure is valid - Ensure all media objects have proper `id` attributes ## Enabling Logging Manually If you prefer to run Gramps manually with logging: ```bash gramps --debug=gramps.gen.lib.media \ --debug=gramps.plugins.import.importxml \ --debug=gramps.gen.db ``` Or enable all logging: ```bash gramps --debug=all ```