mygramps/README_LOGGING.md
Daniel Viegas 7119aedd3d Add portrait display to timeline and tooltips, add portrait generation to demo family
- Add small portraits (24px) next to timeline events for person events
- Add larger portraits (120px) in tooltips when hovering over events
- Implement portrait loading from Gramps media_list using media_path_full
- Add portrait drawing using Cairo with circular clipping and border
- Update demo family generator to create portraits using DiceBear Avatars API
- Generate portraits considering age and gender for appropriate appearance
- Add media objects to XML with proper IDs and gallery references
- Use relative paths for media files in demo family XML
- Add helper scripts for debugging Gramps log files
- Fix deprecation warnings for XML element truth value checks
2025-11-30 11:31:25 +01:00

90 lines
2.1 KiB
Markdown

# 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
```