Skip to content

Remove console.log statements from pubsub module #19

@codemeasandwich

Description

@codemeasandwich

Remove console.log statements from pubsub module

Problem

The server/lib/broadcast/pubsub.js module contains console.log statements that output to stdout during normal operation:

📥 Client ${clientId} subscribed to "${channel}"
📤 Client ${clientId} unsubscribed from "${channel}"
📣 Published to "${channel}" (0 subscribers)
📣 Publishing to "${channel}" (${subscribers.size} subscribers)

Libraries should not log to console by default because:

  1. Pollutes application output - Mixes framework noise with application logs
  2. No user control - Can't filter, format, or redirect these logs
  3. Production overhead - Unnecessary I/O in production environments
  4. Not actionable - The "0 subscribers" case is valid behavior (fire-and-forget), not an error

Expected Behavior

api-ape should be silent by default. Users who want visibility into pub/sub activity can add their own logging in handler functions.

Proposed Solution

Remove all console.log statements from pubsub.js (and any other modules with similar logging).

Files Affected

  • server/lib/broadcast/pubsub.js
  • server/socket/send.js (has binary registration logs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions