Conversation
Introduced mw_api/logging_config.py to provide logging setup with colored output using colorlog. Updated requirements.in to include colorlog. Minor import fix in printe.py and removed a commented line in bot.py.
Logger messages across multiple modules were shortened and standardized by removing redundant method names and clarifying outputs. This improves log readability and consistency throughout the codebase.
Imported and called setup_logging in mw_api/__init__.py to configure logging for the package namespace. Modified setup_logging to accept a logger name parameter for more flexible configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactorings across the
mw_apipackage, focusing on code readability, logging standardization, and import organization. The most significant changes include replacing custom print-based logging with Python's standardloggingmodule, cleaning up imports, and improving code formatting for better maintainability.Logging and Output Refactoring:
printe.outputandprinte.warnfunctions with calls to the standardloggingmodule across various modules, includingapi_utils/botEdit.py,api_utils/ask_bot.py,api/api/client.py, andapi/token_manager.py. This standardizes logging practices and makes log management more flexible. [1] [2] [3] [4]Import and Initialization Cleanup:
__init__.py,all_apis.py,db_bot.py, andpymysql_bot.py. This includes grouping imports, removing redundant imports, and updating import order. [1] [2] [3] [4]API Client and Utility Improvements:
MediaWikiApiClientandTokenManagerto use logging, improved parameter formatting, and made function signatures more consistent and readable. [1] [2] [3] [4] [5] [6]Code Formatting and Readability:
db_bot.py,pymysql_bot.py, and related files. [1] [2] [3] [4]Other Minor Cleanups:
These changes collectively improve the maintainability, readability, and consistency of the codebase.