Skip to content

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

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.)

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasksgood first issueGood for newcomersrefactorRefactoring existing code

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions