wulf-pulse/scripts
root e25eb3fa5e feat: implement structured logging for sync operations
- Add comprehensive structured logging utility (lib/utils/sync-logger.ts)
  - Log levels: DEBUG, INFO, WARN, ERROR
  - Automatic error categorization (NETWORK_ERROR, AUTH_ERROR, DATABASE_ERROR, etc.)
  - Phase tracking (INITIALIZING, FETCHING, MAPPING, VALIDATING, UPSERTING, DELETING, COMPLETING)
  - Contextual metadata (syncId, entityType, phase, duration, record counts)
  - Timing helpers for operations

- Update sync-service.ts with structured logging
  - Replace console.log/error with structured logger
  - Consistent error categorization across all error paths
  - Fix swallowed errors in sync history updates
  - Add child loggers for entity-specific operations

- Update entity-sync.ts with structured logging
  - Complete phase tracking throughout sync lifecycle
  - Detailed context for warnings and errors
  - Update chunked sync methods with structured logging
  - Update picklist sync methods (issue types, sub-issue types)
  - Better debugging info with timing and sample data

- Add sync failure analysis script (scripts/analyze-sync-failures.ts)
  - Query sync history by date range, entity type, or status
  - Generate failure summaries by entity
  - Automatic error categorization
  - Calculate success rates and statistics
  - Display detailed sync records with timing

- Add comprehensive documentation (docs/SYNC_LOGGING_IMPROVEMENTS.md)
  - Usage guide and examples
  - Migration guide for developers
  - Before/after comparisons

This addresses inconsistent logging and improves debugging capabilities for sync operations.
2026-01-23 08:02:02 -05:00
..
analyze-sync-failures.ts feat: implement structured logging for sync operations 2026-01-23 08:02:02 -05:00
apply-migrations.sh Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
run-migration-008.sh Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
test-auvik-config.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
test-postgres.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00