Skip to content

Standardize backend logging and remove direct console usage #65

Description

@pragmaticAweds

Context

Several backend paths still use console.error, console.warn, or console.info directly, including distribution services/controllers, database reset handling, migration generation, and utility transaction handling. The project already has a logger utility, so production logs should use one consistent path and avoid ad hoc console output.

Scope

  • Replace direct console usage in backend runtime code with src/utils/logger
  • Keep test-only console usage unchanged unless it affects output quality
  • Ensure logged errors include useful context without leaking secrets or request tokens
  • Align distribution and donation controller logging with shared error handling conventions
  • Add lint rule or documented convention to prevent new direct console usage where practical

Out of Scope

  • Introducing a new logging provider
  • Changing log transport infrastructure
  • Rewriting the global error handler

Acceptance Criteria

  • Runtime backend code no longer uses direct console.* for errors/info/warnings
  • Logger usage includes actionable context for failures
  • No secrets or authorization headers are logged
  • bun run type-check passes
  • bun run test passes
  • bun run lint passes

Suggested Files or Packages

  • src/components/v1/distribution/
  • src/components/v1/Donation/
  • src/config/persistence/data-source.ts
  • src/scripts/generate-migration.ts
  • src/utils/
  • eslint.config.mjs

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

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