Debugging
Tips for debugging LusterCMS issues.
Backend Debugging
Logging
import logging
logger = logging.getLogger(__name__)
logger.debug("Debug message")
logger.info("Info message")
logger.warning("Warning message")
logger.error("Error message")
View logs:
docker logs infrastructure-backend-1 -f
Python Debugger
import pdb; pdb.set_trace()
# or
breakpoint()
GraphQL Debugging
Enable GraphiQL at /graphql for:
- Schema exploration
- Query testing
- Error inspection
Frontend Debugging
React DevTools
Install browser extension for:
- Component tree inspection
- Props/state viewing
- Performance profiling
Network Tab
Check API calls:
- Request/response bodies
- Headers
- Timing
Console Logging
console.log('Debug:', data);
console.table(items);
console.time('operation');
// ... code
console.timeEnd('operation');
Common Issues
"Document not found"
Y.js collaboration issue:
- Check WebSocket connection
- Verify document ID
- Restart collab server
"Insufficient credits"
AI operation blocked:
- Check credit balance
- Purchase more credits
- Verify operation cost
"Permission denied"
RBAC issue:
- Check user role
- Verify permission assignment
- Check route guards
Docker Debugging
# View logs
docker compose logs -f
# Enter container
docker exec -it infrastructure-backend-1 bash
# Check health
docker compose ps
Database Debugging
# Connect to PostgreSQL
docker exec -it infrastructure-db-1 psql -U postgres
# View tables
\dt
# Query data
SELECT * FROM content_entries LIMIT 10;