--- id: e5d04c92-8f16-44b4-a6f3-94317ea88758 type: workflow title: "PR review: paper-dynasty-database#46 — centralize logging config in main.py" tags: [pr-reviewer, paper-dynasty-database, python, logging, fastapi] importance: 0.4 confidence: 0.8 created: "2026-03-04T00:19:08.984576+00:00" updated: "2026-03-04T00:19:09.401178+00:00" relations: - target: 947fe7fd-b23c-4e46-8065-51c0519f2756 type: RELATED_TO direction: outgoing strength: 0.73 edge_id: 7e73b462-12c0-4ffb-9729-0b93a8bd24cc - target: 04e57a23-0a20-49d6-8c5a-2fa5fc4e55b5 type: RELATED_TO direction: outgoing strength: 0.73 edge_id: 987e2566-a9ab-4dcb-b162-3c2285ef2686 - target: d36a86f0-8183-4c94-8d63-0be65d3fd63a type: RELATED_TO direction: outgoing strength: 0.73 edge_id: 727f8ef1-ecc0-4804-a663-510f4ac16d15 --- ## Review Summary **PR #46** — fix: centralize logging config in main.py (#26) **Branch**: ai/paper-dynasty-database#26 → next-release **Verdict**: APPROVED (posted as COMMENT — Gitea blocks self-approval) ## Key Findings ### What the PR does - Moves the single authoritative `logging.basicConfig()` to `app/main.py`, before any sub-module imports - Removes duplicate no-op `basicConfig` calls from `db_engine.py`, `dependencies.py`, and 30 router files in `routers_v2/` - Removes `LOG_DATA` dict and `date`/`log_level` locals from `dependencies.py` and `db_engine.py` - Fixes `"WARN"` string level → `logging.WARNING` constant (correctness improvement) ### Verified correct - All 30 router files that keep `import logging` still use `logging.*` calls directly in handlers — no orphaned imports - Remaining imports in `dependencies.py` and `db_engine.py` all still have active uses after cleanup - `basicConfig` in `main.py` executes before `db_engine` and router modules are imported — correct ordering ### Minor note (non-blocking) - Date format `f"{datetime.now().year}-{datetime.now().month}-{datetime.now().day}"` produces un-padded dates (e.g. `2026-3-3`). Pre-existing behavior, not a regression. ## Gitea Note Gitea blocks `APPROVED` state on PRs where the reviewer is the PR author. Posted as `COMMENT` with explicit APPROVED verdict in body.