Skip to content
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

Feature Suggestion: Make STDOUT color yellow if string starts with... #70

Open
ghost opened this issue Mar 18, 2019 · 3 comments
Open

Comments

@ghost
Copy link

ghost commented Mar 18, 2019

Amazing project. Just love it.

Here a suggestion for a new feature:

Make stdout text yellow if the the string starts with a user defined set of strings, like "warn" or "err". (we don't actually need regexps to avoid teh overhead)

We could make it a bit smart to avoid the initial chars on the line that are not actual chars (including stars, spaces, tabs, etc).

I am not sure if this would work to be honest due to buffering... I would like to hear your opinion on this.

Thanks

@ghost
Copy link
Author

ghost commented Mar 20, 2019

I could propose I change myself. Still interesting to hear your thoughts on this matter.
Thanks

@ssbarnea
Copy link
Collaborator

ssbarnea commented Aug 4, 2019

I am curious in which direction this could go because now I rely complex iTerm regexes for coloring the output. If stderred could strd doing that I port them and rely less on iTerm (which is MacOS only)

@BrandonStaab
Copy link

This would also allow color escape codes to only be emitted on new lines instead of every time printf is called. Many programs print as they go, which is fine until the program changes the color, does some work, and then tries to print some more stuff. The end result is the color gets changed back by stderred and the application's color is not seen.

For example the backward.cpp library pretty prints backtraces with color, but doesn't work with stderred without modifying the source code because of the previously described behavior.

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

No branches or pull requests

2 participants