Conversation
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 refactors the logging setup throughout the codebase to remove dependencies on the custom
logger_managermodule and instead use Python's built-inloggingmodule directly. Thread-specific loggers are now created using the thread ID in the logger name, and file handlers are managed explicitly. This change improves maintainability and reduces reliance on custom utilities.Logging Refactor and Cleanup:
Replaced all usages of
get_thread_loggerand related utilities fromprometheus.utils.logger_managerwith direct instantiation of loggers using Python's standardloggingmodule andthreading.get_ident()to ensure thread-specific loggers. This affects several files includingissue_service.py,base_container.py, and multiple nodes underprometheus/lang_graph/nodes/. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]Updated logger initialization in constructors to use
logging.getLogger(f"thread-{threading.get_ident()}.{__name__}")instead of the previous custom logger manager, ensuring each thread has a uniquely named logger. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]In
issue_service.py, replaced custom log file handler management (remove_multi_threads_log_file_handler,clear_current_thread_session) with direct calls tologger.removeHandlerandfile_handler.close()to clean up file handlers after use.Dependency Cleanup:
get_thread_loggerand related functions fromprometheus.utils.logger_manageracross the affected files, since logging is now handled directly. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Thread Safety and Logging Consistency:
These changes modernize and simplify the logging approach, making the codebase easier to maintain and debug in concurrent execution scenarios.