strix
strix copied to clipboard
feat: Add `--verbose` / `--debug` CLI Flags
Closes #144
Summary
- Add
-v/--verboseflag (stackable: -v, -vv, -vvv) for increasing log verbosity - Add
--debugflag as shortcut for maximum verbosity (-vvv) - Logs output to both stderr and
strix_runs/{run_name}/debug.logwhen verbosity > 0 - At
-vvv/--debug, enables litellm verbose mode for LLM debugging
Behavior
| Flag | Level | stderr | File |
|---|---|---|---|
| (none) | ERROR | yes | no |
-v |
WARNING | yes | yes |
-vv |
INFO | yes | yes |
-vvv / --debug |
DEBUG | yes | yes |
Implementation Notes
- Removed conflicting global
logging.getLogger().setLevel(logging.ERROR) - Uses
logging.basicConfig(force=True)to ensure configuration is applied - Uses
litellm._logging._enable_debugging()for correct litellm debug toggle - Log file created in run directory after run name is generated
Other Considerations
Log Rotation / Max Size
- Current implementation appends to debug.log indefinitely
- Could add rotation or size limits for long-running sessions in future PR
Colored Log Output
- Could use rich for colored stderr logging
- Would improve readability in terminal
While this is maybe a start, the output is really ugly and breaks the TUI. It also doesn't show the HTTP request body or response body in the output.