refactor(frontend): Replace console.log with logger utility - Sprint 3 Story 1
Replace all console.log/warn/error statements with unified logger utility. Changes: - Replaced console in lib/hooks/use-stories.ts - Replaced console in lib/signalr/SignalRContext.tsx - Replaced console in lib/hooks/useProjectHub.ts - Replaced console in lib/hooks/use-tasks.ts - Replaced console in lib/hooks/useNotificationHub.ts - Replaced console in lib/hooks/use-projects.ts - Replaced console in app/(dashboard)/projects/[id]/kanban/page.tsx Logger respects NODE_ENV (debug disabled in production). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import { SignalRConnectionManager, ConnectionState } from './ConnectionManager';
|
||||
import { SIGNALR_CONFIG } from './config';
|
||||
import { useAuthStore } from '@/stores/authStore';
|
||||
import { toast } from 'sonner';
|
||||
import { logger } from '@/lib/utils/logger';
|
||||
|
||||
// ============================================
|
||||
// TYPE DEFINITIONS
|
||||
@@ -110,12 +111,12 @@ export function SignalRProvider({
|
||||
|
||||
const connect = useCallback(async () => {
|
||||
if (!isAuthenticated) {
|
||||
console.warn('[SignalRContext] Cannot connect: user not authenticated');
|
||||
logger.warn('[SignalRContext] Cannot connect: user not authenticated');
|
||||
return;
|
||||
}
|
||||
|
||||
if (managerRef.current?.state === 'connected') {
|
||||
console.log('[SignalRContext] Already connected');
|
||||
logger.debug('[SignalRContext] Already connected');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,7 +149,7 @@ export function SignalRProvider({
|
||||
try {
|
||||
await manager.start();
|
||||
} catch (error) {
|
||||
console.error('[SignalRContext] Connection error:', error);
|
||||
logger.error('[SignalRContext] Connection error:', error);
|
||||
if (showToasts) {
|
||||
toast.error('Failed to connect to real-time updates');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user