Skip to content

Conversation

@PeterMitrano
Copy link

I ported this from #26 to rolling :)

Motivation

I like to print things with color, using Colorama in python this is super easy.

from colorama import Fore, Style, init
import colorama
colorama.init(autoreset=True)
rospy.loginfo(Fore.RED + Style.BRIGHT + "bold and red!")

However, this would shows up in the rqt console with no color and lots of ugly ansi codes

What this does

makes foreground/background color and bold work, via the standard model/view abstraction mechanisms. One pitfall could be the regex I came up with it. It's possible it has false positives.

Here's a screenshot of what it looks like for me with some test logs messages

2020-09-08-002906_1909x203_scrot

Peter and others added 2 commits November 16, 2025 12:58
To test, install `colorama` and run test/test_colorama_logging.py
@peter-mitrano-ar
Copy link

Another example , you can reproduce it by running this example from ros2_control_demos

ros2 launch ros2_control_demo_example_7 r6bot_controller.launch.py gui:=false
image

@arne48
Copy link
Contributor

arne48 commented Nov 17, 2025

Hello @PeterMitrano ,
Thank you very much for contributing to this package.
Eye-candy is always a nice way to improve the user-experience.
So generally I would like to merge it.
I think it would also beneficial, if there is an option (tick-box) to control (enable/disable) this new behavior.
Would it be possible for you to extend your PR with this functionality?

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