-
Notifications
You must be signed in to change notification settings - Fork 252
Description
I was reading through the codebase and noticed there are quite a few print() statements scattered throughout (I counted around 200+). While this works for quick debugging, it makes it harder to control output in production environments and doesn't follow Python logging best practices.
Current Issues:
- No log level control - Can't filter debug vs info vs warning messages
- Hard to debug in production - No timestamps, no module context, no log levels
- Inconsistent with project standards - The project already uses absl-py for flags, but logging is inconsistent
- Can't redirect or suppress output - Print statements always go to stdout
Examples I Found:
In various files
print(f"Agent {self.name} taking action...")
print("Memory retrieved:", memories)
print(f"Debug: {some_variable}")
Proposed Solution:
Replace print statements with absl.logging (already a dependency) or Python's standard logging module:
from absl import logging
Instead of print
logging.info("Agent %s taking action...", self.name)
logging.debug("Memory retrieved: %s", memories)
I'd be happy to work on this systematically across the codebase. I think it's a good way to get familiar with all the modules while improving code quality.
Would the team be open to this? Happy to start with a small PR on a single module to get feedback on the approach before doing the full refactor.