Background
There are multiple instances of console.log() and console.error() repo-wide. These are accompanied with eslint disable comments. Instances have been identified in #381. Logging behavior is also inconsistent in apps/packages/.
Main concerns:
- PII (personally identifiable information) can be logged in browser (bad)
console is now an error in eslint
- inconsistent and unclear logging generally
Files with this issue are listed below:
apps/blade/src/app/_components/admin/club/events/view-attendance-button.tsx
apps/blade/src/app/_components/admin/club/members/member-profile.tsx
apps/blade/src/app/_components/admin/hackathon/events/view-attendance-button.tsx
apps/blade/src/app/_components/admin/hackathon/judge-assignment/judges-client.tsx
apps/blade/src/app/_components/dashboard/hacker/hacker-application-form.tsx
apps/blade/src/app/_components/dashboard/member-dashboard/download-qr-pass.tsx
apps/blade/src/app/api/trpc/[trpc]/route.ts
apps/club/src/app/_components/contact/contact-form.tsx
packages/auth/src/config.ts
packages/db/scripts/bootstrap-superadmin.ts
packages/db/scripts/get_prod_db.ts
packages/db/scripts/seed_devdb.ts
packages/utils/src/logger.ts (this is a placeholder logger)
Implementation
- Update
console.log() and console.error() to the logger repo-wide
- Remove TODO and eslint suppressions from all instances
- Actually implement
packages/utils/src/logger.ts
- Scope decisions (could take a while):
- how and when to use
.log() and .error() in the logger.
- what data should not be logged (PII for example, might involve more changes)
- how the logger should work on the client and server (to avoid leaking sensitive data)
Scope decisions are OOS for this issue and will likely be handled later, due to broader discussion on the topic.
Background
There are multiple instances of
console.log()andconsole.error()repo-wide. These are accompanied with eslint disable comments. Instances have been identified in #381. Logging behavior is also inconsistent inapps/packages/.Main concerns:
consoleis now an error in eslintFiles with this issue are listed below:
apps/blade/src/app/_components/admin/club/events/view-attendance-button.tsxapps/blade/src/app/_components/admin/club/members/member-profile.tsxapps/blade/src/app/_components/admin/hackathon/events/view-attendance-button.tsxapps/blade/src/app/_components/admin/hackathon/judge-assignment/judges-client.tsxapps/blade/src/app/_components/dashboard/hacker/hacker-application-form.tsxapps/blade/src/app/_components/dashboard/member-dashboard/download-qr-pass.tsxapps/blade/src/app/api/trpc/[trpc]/route.tsapps/club/src/app/_components/contact/contact-form.tsxpackages/auth/src/config.tspackages/db/scripts/bootstrap-superadmin.tspackages/db/scripts/get_prod_db.tspackages/db/scripts/seed_devdb.tspackages/utils/src/logger.ts(this is a placeholder logger)Implementation
console.log()andconsole.error()to the logger repo-widepackages/utils/src/logger.ts.log()and.error()in the logger.Scope decisions are OOS for this issue and will likely be handled later, due to broader discussion on the topic.