Skip to content

Standardized logging, remove repo-wide console usage #402

Description

@must108

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

  1. Update console.log() and console.error() to the logger repo-wide
  2. Remove TODO and eslint suppressions from all instances
  3. Actually implement packages/utils/src/logger.ts
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions