Spaces:
Sleeping
Sleeping
|
Download implementation_plan.md from harshitmahour360/ARY: direct link, hf CLI and curl.
- Browser
- Download file 2.14 kB
-
https://huggingface.co/spaces/harshitmahour360/ARY/resolve/main/implementation_plan.md
- Command line
-
hf download hf://spaces/harshitmahour360/ARY/implementation_plan.md
-
curl -L -o implementation_plan.md https://huggingface.co/spaces/harshitmahour360/ARY/resolve/main/implementation_plan.md
2.14 kB
Implementation Plan: Production-Grade Logging
Replace all print() statements with structured logging using the Python logging module to meet production readiness standards.
User Review Required
The format of the output in
inference.pywill change from plain text to structured log lines (e.g.,2026-04-03 14:45:00 [INFO] [inference.py] ...). If you use automated tools to parse the "START/STEP/END" markers, they should be updated to handle the log prefix.
Proposed Changes
SupportDesk Environment Core
[NEW] logging_config.py
- Create a shared
get_logger(name)utility. - Set a default level of
INFO, configurable via theLOG_LEVELenvironment variable. - Format:
%(asctime)s [%(levelname)s] [%(name)s] - %(message)s.
Agent & Utilities
[MODIFY] inference.py
- Import and initialize the logger.
- Update
_print_start,_print_step, and_print_endto uselogger.info(). - Replace all other
print()calls with appropriate levels (info,error,warning).
[MODIFY] smoke_test.py
- Replace progress prints with
logger.info(). - Replace error prints with
logger.error().
[MODIFY] validate.py
- Replace informative prints with logging.
- Note: Keep the final JSON result as a
print()if it's used for shell piping/automation, or transition to a structured log.
Open Questions
- Output Level: Should we default the log level to
DEBUGfor more verbosity during development, or keep it atINFO? - Clean Logs: Would you like the "OpenEnv" markers (
[START],[STEP]) to remain "clean" without the timestamp prefix for easier parsing?
Verification Plan
Automated Tests
- Run
pytestto ensure logging integration doesn't break logic. - Run
python inference.py --offlineto verify log appearance.
Manual Verification
- Run
python smoke_test.pyand verify terminal output.