Logging System
NC-Scorer includes a comprehensive logging system for debugging and monitoring.
Viewing Logs
- Click the log icon in the footer
- Use filters to view specific log levels
- Search for specific entries
- Export logs as JSON for analysis
Log Levels
| Level | Use Case |
|---|---|
| DEBUG | Detailed debugging information |
| INFO | General application operations |
| WARN | Potential issues, retry attempts |
| ERROR | Critical failures |
For Developers
Basic Usage
javascript
import { logService } from '@/services/logService';
// Log messages
logService.info('User action', { action: 'search', query: 'PKD1' });
logService.error('API failed', error);Configuration
javascript
import { LogLevel } from '@/services/logService';
// Set minimum log level
logService.setLevel(LogLevel.INFO);
// Enable console output
logService.setConsoleEcho(true);Features
- Auto-rotation: Keeps last 50 entries to prevent memory issues
- Persistence: Log level preference saved across sessions
- Export: Download logs for sharing or analysis
- Filtering: View logs by level or search term
Best Practices
- Use appropriate log levels
- Include relevant context data
- Never log sensitive information
- Clear logs periodically for performance
