-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Colored Text in Terminal [Enhancement] #4878
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
Comments
Hello, EDIT: This is made for UNIX like system, specifically here on Gentoo Linux. Don’t know how to achieve the same thing for Windows. I do agree with you, I would like to see something Built-In for such. Currently I am working on it and it is actually possible to drop colors in your output, please see my screenshot (Robotframework + SeleniumLibrary + DataDriver). To do that, it’s not very difficult but do makes your code looks like spaghetti… This is how I do it, for now: 1/ First, I declare the BASH’s color into variable in my resources.robot file:
Then I also define pre-colored new variables:
Once it is made, in my actual test cases .robot’s file I can use them like this:
As you can see on my screenshot, it works very well. BUT. Let me shows now how unreadable could your code be after you started using this…:
And in my actual example, I’ve more than a dozen of these, it’s awful to read (another example):
It works, but there is several cons to this method: 1/ This is absolutely not easy to reproduce for any other message you want to log to console. I’m currently trying to write a keywords doing this, but I struggle with Evaluate and Log To Console behavior once I try to set this method out of my actual test file. So yeah, you can already do it (at least on UNIX alike), but it’s painful. I hope this is helping anyone wondering. Regards, |
Uh oh!
There was an error while loading. Please reload this page.
"Log To Console" Keyword is useful to address some values or debugging, but if the text in Terminal is colored, it would be great!
The text was updated successfully, but these errors were encountered: