Conversation
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
Summary of ChangesHello @anandhu-eng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience of the benchmarking tool by introducing colored log output. By visually distinguishing log levels such as INFO, WARNING, and ERROR, users can more quickly identify critical information during long benchmark runs. The implementation is robust, offering default color enablement while also adhering to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces colored log output, which is a great enhancement for user experience. The implementation is well-done, featuring a ColoredFormatter that correctly applies colors to log levels and respects the NO_COLOR standard. The inclusion of colorama ensures cross-platform support. I'm particularly impressed with the comprehensive unit tests that cover various cases, ensuring the new functionality is reliable. I have one suggestion to make the logging setup more robust, but overall, this is an excellent contribution.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
arekay-nv
left a comment
There was a problem hiding this comment.
Please make this opt-in, so disabled by default. Would be great to have colored logs - thanks!
There was a problem hiding this comment.
Pull request overview
This PR adds colored log output to the benchmarking tool to improve readability. Log levels are now color-coded (INFO=green, WARNING=yellow, ERROR/CRITICAL=red) using colorama, with colors disabled by default but can be enabled via the FORCE_COLOR_LOGGING environment variable.
Key Changes:
- Extracted
ColoredFormatterclass for applying colors to log level names only - Added
colorama==0.4.6dependency for cross-platform color support - Comprehensive test suite with 13 tests achieving 97% code coverage
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/inference_endpoint/utils/logging.py | Implements ColoredFormatter class and updates setup_logging() to support optional colored output via environment variable |
| requirements/base.txt | Adds colorama dependency for terminal color support |
| tests/unit/test_logging.py | New test file with 13 tests covering color formatting, environment variable handling, and logger configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this PR do?
This PR adds colored log output to improve readability and UX for benchmarking tool users. Log levels are now color-coded (INFO=green, WARNING=yellow, ERROR/CRITICAL=red) using colorama, with support for the NO_COLOR standard.
Problem
Benchmarking logs are difficult to scan when all output is monochrome. Users cannot quickly distinguish between informational messages, warnings, and errors during long benchmark runs.
Solution
ColoredFormatterclass that applies colors only to log level namesNO_COLOR=1environment variable for users/systems that disable colorsChanges
src/inference_endpoint/utils/logging.py
ColoredFormatterclass (previously nested insetup_logging())NO_COLORenv var is setrecord.levelnamefor output, restores it afterward to prevent state pollutionrequirements/base.txt
colorama==0.4.6as a runtime dependency for Windows/cross-platform supporttests/unit/test_logging.py (new file)
ColoredFormatterbehaviorsetup_logging()configurationExample output:

Type of change
Related issues
Testing
Five tests are currently failing when I run pytest. I am not certain whether this is specific to my environment. The last few logs are included below:
Checklist