Diagnostic Logs
Format
console.log('[IDENTIFIER] Clear purpose message', JSON.stringify({ object: data }));
Requirements
- Clear purpose - What is this log telling you?
- Single filterable identifier -
[UPPER_CASE] prefix (e.g., [THUMB_STRIP], [RENDER])
- Stringified objects - Use
JSON.stringify() for easy copying from browser console
- Remove when done - Delete diagnostic logs after debugging is complete
Examples
// ✅ Good
console.log('[THUMB_STRIP] Starting animation', JSON.stringify({
loadingCount: 3,
totalSlots: 10
}));
// ❌ Bad - no identifier, object not stringified
console.log('Starting animation', { loadingCount: 3 });