You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Centralize logging and Sentry error reporting (#871)
## Description
- **Centralized Logger**: Replace `app/utils/logger` (static class,
default export) with `app/shared/lib/logger` (singleton instance, named
export)
- **Sentry consolidation**: All direct `@sentry/nextjs` imports replaced
by `Logger.panic()`/`Logger.warn({ sentry: true })` or re-exports from
`app/shared/lib/sentry/`. ESLint `no-restricted-imports` rule enforces
this boundary
- **Global error boundaries**: New `app/error.tsx` and
`app/global-error.tsx` catch route-level and root-level errors,
replacing per-component ErrorBoundary wrappers
- **ESLint enforcement**: `no-console: error` globally to prevent
regression
- **Sentry SDK upgrade**: Pin `@sentry/core` and `@sentry/nextjs` to
`10.39.0`, migrate build config to
`webpack.treeshake.removeDebugLogging`
- **Test cleanup**: Global Logger mock in `test-setup.specs.ts` replaces
~8 per-file mock blocks
### Breaking changes
- `NEXT_PUBLIC_ENABLE_CATCH_EXCEPTIONS` env var removed — Sentry capture
is now always-on when DSN is configured
- `SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING` env var removed
- Import paths changed: `@utils/logger` → `@/app/shared/lib/logger`,
`SentryErrorBoundary` and `withTraceData` moved to
`@/app/shared/lib/sentry`
## Type of change
<!-- Check the appropriate options that apply to this PR -->
- [x] Other (please describe): Enable sentry for all pages, logger
refactoring
## Screenshots
<!-- For UI changes, especially protocol screens, include screenshots
showing the changes -->
<!-- This is REQUIRED for protocol integration PRs -->
## Testing
<!-- Describe how you tested your changes -->
<!-- For protocol integrations, explain how you verified the protocol
data is correctly displayed -->
## Related Issues
Closes
[HOO-246](https://linear.app/solana-fndn/issue/HOO-246/enable-sentry-for-all-the-pages)
## Checklist
<!-- Verify that you have completed the following before requesting
review -->
- [x] My code follows the project's style guidelines
- [x] I have added tests that prove my fix/feature works
- [x] All tests pass locally and in CI
- [x] I have updated documentation as needed
- [x] I have run `build:info` script to update build information
- [x] CI/CD checks pass
---------
Co-authored-by: Sergo <rogaldh@radsh.red>
Copy file name to clipboardExpand all lines: .eslintrc.json
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,8 @@
22
22
"message": "RegExps are not recommended. If you sure regexp is needed - please use eslint-disable-next no-restricted-syntax -- %comment% to explain why"
0 commit comments