Skip to content

routes.py has 30 bare print() calls, violating the context["log"] convention #11

Description

@carochacs

Correction (see PR #12 discussion): the "Ask" below originally said to replace print() calls with context["log"], based on the core CLAUDE.md's "Backend plugin logging" guidance. That doesn't reflect this plugin's actual convention. Verified directly against got-feedback/feedback-plugin-editor (the org this repo derives from): routes.py there — and here — logs via logging.getLogger("slopsmith.plugin.editor") at every call site; there is no context["log"]-bound logger anywhere in this plugin, upstream or in this fork. context["log"] is aspirational core-wide guidance that this plugin never actually adopted — don't introduce it here now.

Problem

This repo's own CLAUDE.md states under Conventions: "All backend output via context["log"], never print()." However, routes.py currently has 30 bare print() calls (confirmed via grep -c "print(" routes.py), including at least lines 1526, 4759, 4880, and 4955.

Bare print() bypasses:

  • Correlation IDs that a proper logger attaches automatically
  • The app-wide log level configuration (a print() always emits regardless of configured level)
  • JSON-mode log formatting, if the deployment has structured logging enabled

Ask

Audit routes.py for all bare print() calls and replace them with logging.getLogger("slopsmith.plugin.editor").info(...) / .warning(...) / .exception(...) — the pattern already used at every other logging site in this file, and in got-feedback's upstream routes.pynot context["log"]. PR #12 already converts the replace-audio handler's print() to this pattern as a reference example; the rest of this file's print() call sites still need the same treatment.


Migrated from Maestro-Ltd/slopsmith-plugin-editor#20.

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions