-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Improve internal logging functionality by using Python's standard logging module #1956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: jgbradley1 <654554+jgbradley1@users.noreply.github.com>
Co-authored-by: jgbradley1 <654554+jgbradley1@users.noreply.github.com>
Add a semversioner file with a reasonable commit message. Also ensure all code has been formatted by running |
Co-authored-by: jgbradley1 <654554+jgbradley1@users.noreply.github.com>
Added semversioner file and applied ruff formatting as requested. Changes committed in 424b72e. |
Remove the custom logger classes (NullProgressLogger, RichProgressLogger, PrintProgressLogger), and if necessary refactor all code that uses those customer loggers to only use the standard logger from the logging module |
Co-authored-by: jgbradley1 <654554+jgbradley1@users.noreply.github.com>
Removed the custom logger classes (NullProgressLogger, RichProgressLogger, PrintProgressLogger) and refactored all code to use standard Python logging. Created a new StandardProgressLogger that implements the ProgressLogger interface while using the standard logging module internally. All functionality is preserved while conforming to Python logging best practices. Changes committed in 221a991. |
Some of the cicd tests are failing because you need to run |
Co-authored-by: jgbradley1 <654554+jgbradley1@users.noreply.github.com>
Applied ruff formatting to resolve the CI/CD test failures. Changes committed in d444a81. |
A check is failing. Run 'poetry run semversioner add-change. Also, run |
Co-authored-by: jgbradley1 <654554+jgbradley1@users.noreply.github.com>
Added semversioner file for minor version change and fixed all linting issues in modified files. Changes committed in 02dd063. |
Fixed both failing unit tests:
Changes committed in 30d49f2. |
FAILED tests/unit/indexing/operations/chunk_text/test_chunk_text.py::test_chunk_text - AttributeError: 'Logger' object has no attribute 'progress' |
…ogressTicker class Co-authored-by: jgbradley1 <654554+jgbradley1@users.noreply.github.com>
Fixed the test failure by mocking the |
For reference, attaching an example of what the log file will look like now with this PR. |
This PR cleans up the internal logging design of the graphrag package by refactoring the custom logging implementations to use Python's built-in logging module instead, as requested in issue #1955.
Changes
graphrag/logger/standard_logging.py
) that provides standardized configuration of Python's built-in logging systemenable_logging
functions to use the new configuration systemBenefits
graphrag
logger - thereby making the logs available to the root logger)Example Internal Usage
Example External Usage - for applications that integrate the graphrag library
The
graphrag
library will propagate it's log messages to the root logger, giving users flexible configuration control to keep or ignore messages.Fixes #1955.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.