Add debug logs

This commit is contained in:
Muzhen Gaming
2025-10-16 09:49:22 +08:00
parent 19cf0aeb8c
commit 1f9f921829
2 changed files with 94 additions and 5 deletions

View File

@@ -24,6 +24,14 @@
- Or set env vars instead: `OPENAI_API_KEY` and optionally `OPENAI_BASE_URL`.
- App data directory (captures, response, logs): `%LOCALAPPDATA%\BgVisionAgent`.
**Debug Logging**
- Enable detailed step-by-step logs by setting either env var before launch:
- PowerShell: ``$env:BG_AGENT_DEBUG='1'`` (or ``$env:DEBUG='1'``)
- Cmd: ``set BG_AGENT_DEBUG=1``
- When enabled, logs are written to `%LOCALAPPDATA%\BgVisionAgent\agent.log` at DEBUG level.
- When not enabled, only warnings/errors go to stderr; no log file is written.
**Notes**
- Windows is supported now; code is structured to later add macOS/Linux window capture backends.