-
Couldn't load subscription status.
- Fork 19.5k
Open
Description
This PR adds flake8-logging-format (G) rules to the ruff configuration and fixes all logging statements in the codebase to use proper logging format strings instead of f-strings. This improves code consistency and follows best practices for logging.
Changes Made:
Configuration Changes:
- Added
G(flake8-logging-format) to the ruff lint select rules inpyproject.toml
Code Changes:
Fixed logging statements in 8 files:
libs/langchain/langchain/agents/agent_iterator.py- Fixed logger.debug calllibs/langchain/langchain/memory/entity.py- Fixed multiple logger.debug callslibs/langchain/langchain/retrievers/multi_query.py- Fixed logger.info callslibs/langchain/langchain/retrievers/re_phraser.py- Fixed logger.info calllibs/langchain/langchain/retrievers/self_query/base.py- Fixed logger.info callslibs/langchain/langchain/smith/evaluation/runner_utils.py- Fixed multiple logger calls including error handling and warningslibs/langchain/pyproject.toml- Added the G rule to ruff configurationlibs/langchain/uv.lock- Updated dependency version
Key Improvements:
- Replaced f-strings with proper logging format strings using %s placeholders
- Improved error handling logging with more detailed information
- Ensured consistent logging format across the codebase
- Added proper exception logging with traceback information
This change aligns the codebase with Python logging best practices and improves maintainability.
Merge Status: Merged on July 14, 2025
Reviewer: @mdrxy (approved with minor suggestion about input key validation that was addressed)
Metadata
Metadata
Assignees
Labels
No labels