Skip to content

refactor: use structured logging instead of print in letter_counting_environment.py#384

Open
alireza78a wants to merge 2 commits intoNousResearch:mainfrom
alireza78a:fix/replace-print-with-logger-letter-counting
Open

refactor: use structured logging instead of print in letter_counting_environment.py#384
alireza78a wants to merge 2 commits intoNousResearch:mainfrom
alireza78a:fix/replace-print-with-logger-letter-counting

Conversation

@alireza78a
Copy link
Contributor

Summary

Replace all print() calls with proper logging in letter_counting_environment.py.

Problem

The file uses print() for config loading messages and import warnings, while already having logging imported and using self.logger elsewhere in the class.

Changes

  • Added module-level logger = logging.getLogger(__name__)
  • Replaced 5 print() calls with appropriate log levels:
    • logger.warning() for missing optional dependencies (NLTK, datasets)
    • logger.info() for successful config loading
    • logger.warning() for missing config file
    • logger.error() for config parsing errors
  • No functional changes

Testing

  • Change is logging-only with zero logic impact
  • pre-commit checks passed

alireza78a and others added 2 commits February 19, 2026 15:57
…ironment.py

Replace all print() calls with proper logging:
- Added module-level logger using logging.getLogger(__name__)
- Import warnings: print() -> logger.warning() for missing NLTK and datasets
- Config loading: print() -> logger.info/warning/error based on severity

This ensures consistent logging behavior across the environment.
@alireza78a alireza78a changed the title refactor: replace print statements with logger in letter_counting_environment.py refactor: use structured logging instead of print in letter_counting_environment.py Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants