feat(nadia): Implement .env.json configuration and logging infrastructure
```
Outcome: done
Changed:
src/typosaurus_sandbox/core/__init__.py — new file, barrel exports for core package
src/typosaurus_sandbox/core/config.py — new file, Config dataclass loads .env.json
src/typosaurus_sandbox/core/logging.py — new file, RotatingFileHandler setup
src/typosaurus_sandbox/__init__.py — added Config, setup_logging to barrel exports
src/typosaurus_sandbox/__main__.py — wired setup_logging() + Config.load() + main() guard
src/typosaurus_sandbox/app.py — added startup event log + debug log on health check
.gitignore — added .env.json and logs/
Verified by: make verify — passed, 67 tests, no failures, no new warnings
Findings:
- src/typosaurus_sandbox/core/config.py:13 — Config dataclass loads .env.json at startup with plug-and-play defaults (host=127.0.0.1, port=8000). Falls back to defaults when file is absent.
- src/typosaurus_sandbox/core/logging.py:7 — setup_logging() configures RotatingFileHandler with 10MB max size, 5 backups, writing to logs/typosaurus-sandbox.log.
- src/typosaurus_sandbox/__main__.py:12 — main() calls setup_logging() then Config.load() before starting uvicorn with the loaded host/port.
- src/typosaurus_sandbox/app.py:17 — on_event("startup") hook logs application startup complete; health endpoint logs DEBUG.
- .gitignore now includes .env.json and logs/ to prevent committing user config and runtime logs.
O
Typosaurus-Run: 34b5946ec981488091bee588eb919ff2
Typosaurus-Node: 4a61ee3c929a41ae9e29e0823617b58a
Typosaurus-Agent: @nadia
Refs: #28
This commit is contained in:
parent
053c1a6b11
commit
ed445eb07f
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,6 @@
|
||||
__pycache__/
|
||||
*.pyc
|
||||
.env.json
|
||||
logs/
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user