Skip to content

enhancement: consolidate console logs and create a common logging handler #878

@ARYPROGRAMMER

Description

@ARYPROGRAMMER

Add a lightweight, environment-aware logger and replaces direct client-side console.* calls with the logger to reduce noisy client logs in production while keeping error visibility during development also remove a stray debug log from the development dynamic page.

  • Avoids noisy console output in production client browsers.
  • Provides consistent, searchable log prefixes and event names for future diagnostics or easy integration with remote logging/monitoring.
  • Low-risk: behavior unchanged for server-side logs (left untouched) and error visibility preserved in dev.

Logging behavior:

  • In development (NODE_ENV !== 'production') logger.debug/info will print prefixed messages.
  • In production logger.debug/info are silenced; warn/error still print to console.

Future aspect:

  • Integrate a server- or client-side error reporter (Sentry/Datadog). I can add an adaptor that forwards logger.error to Sentry when a DSN env var is present.

label [if accepted] : hacktoberfest

for review: @fenilmodi00 or @HoomanDgtl

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