Skip to content

Replace console.error with structured logError in production paths #294

Open

Description

@aadityakumarsah

Summary

Multiple production code paths use raw console.error for error logging, bypassing the existing winston-based telemetry infrastructure (src/telemetry/index.ts).

Affected files

Auth

  • src/auth/verification.ts
  • src/auth/resetPassword.ts
  • src/auth/providers/google.ts
  • src/auth/providers/github.ts
  • src/auth/providers/oauth-common.ts

Server

  • src/app/server.ts
  • src/app/index.ts
  • src/app/metrics.ts
  • src/app/backendApi.ts

Infrastructure

  • src/db/client.ts
  • src/config/sync.ts
  • src/cron/jobs.ts
  • src/migration/index.ts
  • src/routes/handler.ts
  • src/websocket/socketio/server.ts

Fix

Replace each console.error call with logError(message, { error | err }).

logError already delegates to winston (when telemetry is enabled and the logger is initialized) and falls back to console.error when telemetry is not configured, making this a safe, zero-regression change.

PR

#295

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