Skip to content

[Frontend] Replace console.log/warn/error with a real logger in client code #628

@ogazboiz

Description

@ogazboiz

Join the discussion on Telegram

Why this matters

Several frontend modules ship console.* calls into production:

  • frontend/src/app/activity/page.tsx:66console.error(\"Failed to fetch activity:\", error)
  • frontend/src/app/streams/create/page.tsx:70console.error(\"Stream creation failed:\", error)
  • frontend/src/app/streams/[id]/page.tsx:127console.error(\"Failed to fetch events:\", err)
  • frontend/src/components/stream-creation/StreamCreationWizard.tsx:347console.warn(\"Polling error:\", e)
  • frontend/src/components/stream-creation/StreamCreationWizard.tsx:370console.error(\"Failed to create stream:\", error)
  • frontend/src/components/TransactionTracker.tsx:97,135console.error
  • frontend/src/lib/dashboard.ts:172console.error(\"Dashboard data fetch error:\", error)
  • frontend/src/lib/soroban.ts:185console.info(\[soroban:mock] ${label}`)`

There is no central logger. Errors are swallowed in production console; the :mock info even logs in real prod builds.

Acceptance criteria

  • Add a small frontend/src/lib/logger.ts (or import a tiny module) that gates debug/info on process.env.NODE_ENV !== 'production' and always preserves errors
  • Replace each console.* site above with the new helper
  • Update lint config to forbid raw console.* outside the logger module

Files to touch

(all eight files listed above) plus a new frontend/src/lib/logger.ts

Out of scope

  • Sending logs to an external service (Sentry, Datadog, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendFrontend related tasksgood first issueGood for newcomersrefactorRefactoring existing code

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions