Skip to content

feat: structured logger interface — replace 35+ console.* calls #18

Closed

Description

@stackbilt-admin

CodeBeast Audit Finding — P2 MEDIUM

Severity: P2 — Medium
Category: Observability / Library UX
Files: All source files

Problem

35+ console.log/warn/error calls with no:

  • Log level control
  • Suppression mechanism
  • Custom logger injection
  • Production vs development distinction

This is an npm library consumed by other applications. Uncontrolled console output is an anti-pattern — consumers can't filter, redirect, or silence the noise.

Proposed Solution

export interface Logger {
  debug(msg: string, ...args: unknown[]): void;
  info(msg: string, ...args: unknown[]): void;
  warn(msg: string, ...args: unknown[]): void;
  error(msg: string, ...args: unknown[]): void;
}

export const noopLogger: Logger = {
  debug() {}, info() {}, warn() {}, error() {}
};

export const consoleLogger: Logger = {
  debug: console.debug, info: console.log,
  warn: console.warn, error: console.error
};

Accept logger?: Logger in factory/provider config. Default to noopLogger (silent). Users opt in to logging.

🤖 Filed by CodeBeast audit

Activity

  1. added
    enhancement
    P2-medium
    audit
    on Apr 1, 2026
  2. stackbilt-admin commented on Apr 1, 2026

    @stackbilt-admin
    MemberAuthor

    Resolved in 65b1970 — Logger interface, noopLogger, consoleLogger shipped as part of P0 fix (#10, #11).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumauditenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions