fix: replace print(req.scope) with logger.debug in /api/docs (#21) #54
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#54
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-database-21"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
print(req.scope)onapp/main.py:78withlogger.debug(req.scope)so request scope data is routed through the structured rotating-file logger instead of stdout.Files Changed
app/main.py— single functional change:print→logger.debugNotes
logger = logging.getLogger('discord_app')(line 22) is already in scope at the call site.Other observations
import datetimeandimport Dependson lines 1 and 6 are unused (pre-existing, out of scope).Test plan
AI Code Review
Files Reviewed
app/main.py(modified)Findings
Correctness
print(req.scope)→logger.debug(req.scope)atget_docs(line 78 in base).logger = logging.getLogger('discord_app')(line 22) is in scope at the call site. No issues.req.scopeis an ASGI scope dict —logger.debug()will callstr()on it implicitly, same behaviour asprint()but routed through the structured logger.DEBUGlevel is appropriate: this is diagnostic/introspective data, not an error or warning.Security
req.scopemay contain path, headers, and query data, but logging it at DEBUG level (only active whenLOG_LEVEL=DEBUG) into the rotating file logger is acceptable and an improvement over printing to stdout.Style & Conventions
FastAPI(...)) is expected per project setup and consistent with prior PRs.Suggestions
import datetime(line 1) andimport Depends(line 6) are unused. PR author noted these are out of scope — agree, no action needed here.Verdict: APPROVED
Clean, minimal fix. Correct logger reference, appropriate log level, no regressions. Cosmetic reformatting is expected and benign.
Automated review by Claude PR Reviewer