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:
@@ -20,6 +20,7 @@ import { KanbanColumn } from '@/components/features/kanban/KanbanColumn';
|
||||
import { StoryCard } from '@/components/features/kanban/StoryCard';
|
||||
import { CreateStoryDialog } from '@/components/features/stories/CreateStoryDialog';
|
||||
import type { Story, WorkItemStatus } from '@/types/project';
|
||||
import { logger } from '@/lib/utils/logger';
|
||||
|
||||
const COLUMNS = [
|
||||
{ id: 'Backlog', title: 'Backlog', color: 'bg-gray-100' },
|
||||
@@ -50,15 +51,15 @@ export default function KanbanPage() {
|
||||
{
|
||||
// Story events (3 events)
|
||||
'StoryCreated': (event: any) => {
|
||||
console.log('[Kanban] Story created:', event);
|
||||
logger.debug('[Kanban] Story created:', event);
|
||||
queryClient.invalidateQueries({ queryKey: ['project-stories', projectId] });
|
||||
},
|
||||
'StoryUpdated': (event: any) => {
|
||||
console.log('[Kanban] Story updated:', event);
|
||||
logger.debug('[Kanban] Story updated:', event);
|
||||
queryClient.invalidateQueries({ queryKey: ['project-stories', projectId] });
|
||||
},
|
||||
'StoryDeleted': (event: any) => {
|
||||
console.log('[Kanban] Story deleted:', event);
|
||||
logger.debug('[Kanban] Story deleted:', event);
|
||||
queryClient.invalidateQueries({ queryKey: ['project-stories', projectId] });
|
||||
},
|
||||
},
|
||||
@@ -97,7 +98,7 @@ export default function KanbanPage() {
|
||||
const story = stories.find((s) => s.id === active.id);
|
||||
|
||||
if (story && story.status !== newStatus) {
|
||||
console.log(`[Kanban] Changing story ${story.id} status to ${newStatus}`);
|
||||
logger.debug(`[Kanban] Changing story ${story.id} status to ${newStatus}`);
|
||||
changeStatusMutation.mutate({ id: story.id, status: newStatus });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user