Problem
All output goes through raw print() calls — 11 total across agent.py and main.py. There is no way to control verbosity, filter by severity, redirect output to a file, or suppress noise in automated/CI use. Error and debug output is mixed with normal status messages.
Current print() inventory:
| File |
Line |
Severity |
Output |
agent.py:116 |
INFO |
Connected to device: {serial} |
|
agent.py:117 |
INFO |
Screen size: {w}x{h} |
|
agent.py:118 |
INFO |
Task: {prompt} |
|
agent.py:129 |
WARNING |
[!] Failed to read UI: {e} |
|
agent.py:149 |
WARNING |
[!] No action returned, retrying... |
|
agent.py:156 |
INFO |
Step {n}: {action}({args}) |
|
agent.py:160 |
INFO |
Done: {summary} |
|
agent.py:164 |
DEBUG |
→ {result} |
|
main.py:30 |
ERROR |
Error: {e} (to stderr) |
|
main.py:36 |
ERROR |
Error: {e} (to stderr) |
|
main.py:39 |
INFO |
Aborted by user. |
|
Expected behavior
- Use
logging.getLogger("droidpilot") throughout
- Map each message to the correct severity (see table above)
- Default to INFO level for normal use
- Support
--verbose / --quiet CLI flags to control output
- Structured enough to pipe to a file:
droidpilot "..." 2>debug.log
Suggested approach
- Add a
_setup_logging() helper in main.py that configures the root droidpilot logger with a clean format (no timestamps for TTY, timestamps for file output)
- Replace each
print() with the appropriate logger.info() / logger.warning() / logger.error() / logger.debug() call
- Add
--verbose (-v) and --quiet (-q) flags to main.py
- Keep the step-by-step output readable — logging format should stay close to current output unless
-v is passed
Files to change
main.py — logging setup, CLI flags
agent.py — replace all print() calls
Problem
All output goes through raw
print()calls — 11 total acrossagent.pyandmain.py. There is no way to control verbosity, filter by severity, redirect output to a file, or suppress noise in automated/CI use. Error and debug output is mixed with normal status messages.Current print() inventory:
agent.py:116Connected to device: {serial}agent.py:117Screen size: {w}x{h}agent.py:118Task: {prompt}agent.py:129[!] Failed to read UI: {e}agent.py:149[!] No action returned, retrying...agent.py:156Step {n}: {action}({args})agent.py:160Done: {summary}agent.py:164→ {result}main.py:30Error: {e}(to stderr)main.py:36Error: {e}(to stderr)main.py:39Aborted by user.Expected behavior
logging.getLogger("droidpilot")throughout--verbose/--quietCLI flags to control outputdroidpilot "..." 2>debug.logSuggested approach
_setup_logging()helper inmain.pythat configures the rootdroidpilotlogger with a clean format (no timestamps for TTY, timestamps for file output)print()with the appropriatelogger.info()/logger.warning()/logger.error()/logger.debug()call--verbose(-v) and--quiet(-q) flags tomain.py-vis passedFiles to change
main.py— logging setup, CLI flagsagent.py— replace all print() calls