-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: remove debug console statements #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors debug and console logging across the application by replacing console statements with structured logging and user-friendly notifications.
- Replace console.log/error calls with structured logger in server-side code
- Convert client-side alerts and console statements to toast notifications
- Remove debug console output from test files
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/example.test.ts | Remove console debug statements from mock test runner |
| server/vite.ts | Replace console.log with structured logger.info |
| server/storage.ts | Replace console.error with logger.error including context |
| server/routes.ts | Replace console statements with appropriate logger methods |
| server/middleware.ts | Replace console statements with structured logging |
| server/db.ts | Replace console statements with logger methods for database operations |
| server/config.ts | Replace console.error/log with logger methods for configuration |
| server/auth.ts | Replace console statements with logger methods for authentication |
| client/src/lib/telegram.ts | Replace console statements and alerts with toast notifications |
| client/src/components/error-boundary.tsx | Replace console.error with toast notification in error handler |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| override componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { | ||
| console.error("ErrorBoundary caught an error:", error, errorInfo); | ||
| override componentDidCatch(error: Error, _errorInfo: React.ErrorInfo) { |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The _errorInfo parameter is now unused but could be valuable for debugging. Consider including error stack trace or component stack information in the toast notification for better error reporting.
| console.error("Failed to show alert:", error); | ||
| alert(message); | ||
| toast({ variant: "destructive", description: "Failed to show alert" }); | ||
| toast({ description: message }); |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error handling shows two consecutive toast notifications - one for the failure and one for the original message. This could be confusing to users. Consider combining them into a single toast or logging the original error details.
| toast({ description: message }); | |
| toast({ variant: "destructive", description: `Failed to show alert: ${message}` }); | |
| if (error) console.error("showAlert error:", error); |
Summary
Testing
npm run linthttps://chatgpt.com/codex/tasks/task_e_689c181f742c83279276402524062dd6