Skip to content

[Story] Route all diagnostics through the logger and the CodeXR output channel #34

Done

Description

@aMonteSl

As a Code-XR user or maintainer diagnosing a problem,
I want the extension's diagnostics in the "CodeXR" output channel, with levels,
so that I can read them without opening the DevTools console, and production stays quiet.

Context

1,646 console.* calls in src/ versus a logger used by 16 files; 65 catch blocks whose only handling is a console call. Authorized as a user-visible change on 2026-09-18 (ROADMAP §B decision 3).

Scope (ROADMAP W4-L, L01–L22)

  • L01: vscode-free log sink with a pre-initialization buffer and console fallback; logger.ts attaches the output channel. (Kept deliberately small: the host-port abstraction is story [Story] Extract a host-agnostic Code-XR core from the VS Code extension #13 of epic [Epic] Migrate Code-XR from a VS Code extension to its own IDE (Electron + Monaco) #11.)
  • L02: the 65 console-only catch blocks go through the logger at warn/error.
  • L03–L05: characterize and extract the stderr classifier of executePython.ts, then migrate it (126 calls).
  • L06–L21: one commit per area, worst first; each adds the area to the no-console error block and lowers the ratchet.
  • L22: no-console as error for src/** with an allowlist (the sink only).
  • Also: gate the 29 ungated console.log in the two SSE live-reload clients behind the existing DEBUG_MODE.

Acceptance criteria

  • console.* in src/ 1,646 → ≤ 5 (allowlist); console-only catch blocks 65 → 0.
  • Level-preserving mapping (error/warn stay; path-bearing logs become lazy debug); log-literal pins survive verbatim.
  • codeXR.debug.verboseLogs still controls verbosity; nothing is logged before activation is lost.
  • CHANGELOG [1.2.1] → Changed line; npm test + test:analysis green after every commit.

Activity

  1. self-assigned this
    on Nov 25, 2026
  2. added
    tfm
    user-story
    on Nov 25, 2026
  3. added 2 commits that reference this issue on Nov 25, 2026
  4. aMonteSl commented on Nov 25, 2026

    @aMonteSl
    CollaboratorAuthor

    Done in #58, merged into v1.2.1 with CI green on Linux, macOS and Windows. console.* in src/ 1,416 → 2 (the sink's fallback, the only allowlisted file), console-only catch blocks 56 → 0, no-console is an error over src/**/*.ts. CHANGELOG [1.2.1] Changed line added. F5 checks in .claude/docs/v1.2.1/sessions/34-logging.md, run in #43.


    Generated by Claude Code

  5. added
    area: extension
    stream: cleanup-refactor
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: extensionstream: cleanup-refactortfmuser-story

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions