Skip to content

Color coded log messages - #439

Merged
Kyle Rohn (kylerohn-msft) merged 3 commits into
mainfrom
users/kylerohn/colorful-logging
Jul 7, 2026
Merged

Color coded log messages#439
Kyle Rohn (kylerohn-msft) merged 3 commits into
mainfrom
users/kylerohn/colorful-logging

Conversation

@kylerohn-msft

Copy link
Copy Markdown
Contributor

This feature adds color coded logging to the logger initialized by load_configuration_from_env. See the image below to see the color coding:

image

Closes: #438

@kylerohn-msft
Kyle Rohn (kylerohn-msft) requested a review from a team as a code owner July 2, 2026 18:38
Copilot AI review requested due to automatic review settings July 2, 2026 18:38
@kylerohn-msft

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces color-coded console log output for logging configured via load_configuration_from_env, aiming to make severity levels easier to visually scan during development.

Changes:

  • Adds a ColorFormatter to apply ANSI colors based on log severity.
  • Switches the configured StreamHandler to use the new formatter.
  • Disables logger propagation during env-driven logging configuration to reduce duplicated outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 7, 2026 18:01
@kylerohn-msft
Kyle Rohn (kylerohn-msft) force-pushed the users/kylerohn/colorful-logging branch from b76f4d1 to 65d9bfa Compare July 7, 2026 18:01
@kylerohn-msft
Kyle Rohn (kylerohn-msft) enabled auto-merge (squash) July 7, 2026 18:02
@kylerohn-msft
Kyle Rohn (kylerohn-msft) merged commit 2203be7 into main Jul 7, 2026
11 of 12 checks passed
@kylerohn-msft
Kyle Rohn (kylerohn-msft) deleted the users/kylerohn/colorful-logging branch July 7, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines 88 to 92

logger.propagate = False # Prevent log messages from being propagated
logger.handlers.clear() # Remove existing handlers to prevent duplicates
logger.addHandler(console_handler)
logger.setLevel(level)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add colored console log output based on severity level

3 participants