Skip to content

Add colored logging to tools CLI - #649

Merged
glehmann merged 1 commit into
masterfrom
gln/tools-colored-logging-vtzs
Aug 3, 2026
Merged

Add colored logging to tools CLI#649
glehmann merged 1 commit into
masterfrom
gln/tools-colored-logging-vtzs

Conversation

@glehmann

@glehmann glehmann commented Aug 3, 2026

Copy link
Copy Markdown
Member

Apply the colored logger used in the compat kit to the tools package,
so logs emitted by scripts/tools.py are shown with per-level ANSI colors.
Replaces the plain basicConfig logging setup with a ColoredFormatter.

Signed-off-by: Gaëtan Lehmann gaetan.lehmann@vates.tech

@glehmann
glehmann requested a review from a team as a code owner August 3, 2026 13:01

@olivierh-pro olivierh-pro 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.

Based on previous thread, would you plan to add this code snippet globally?

Maybe we should have a module lib/logger.py or something like that?

@olivierh-pro
olivierh-pro requested a review from a team August 3, 2026 14:00
@glehmann
glehmann force-pushed the gln/tools-colored-logging-vtzs branch from adfe9d7 to 3a92673 Compare August 3, 2026 14:35
Extract the ColoredFormatter and setup_colored_logging helpers added to
the tools package into a dedicated lib/logger.py module, so they can be
reused outside of lib/tools. lib/tools/__init__.py now imports
setup_colored_logging from lib.logger.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
@glehmann
glehmann force-pushed the gln/tools-colored-logging-vtzs branch from 3a92673 to 383e477 Compare August 3, 2026 14:41
@glehmann

glehmann commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Based on previous thread, would you plan to add this code snippet globally?

Maybe we should have a module lib/logger.py or something like that?

done

@olivierh-pro olivierh-pro 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.

I've also tested with the -d (debug option). It works as expected!

Good job!

@glehmann
glehmann merged commit 70caf2d into master Aug 3, 2026
11 checks passed
@glehmann
glehmann deleted the gln/tools-colored-logging-vtzs branch August 3, 2026 15:46
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.

3 participants