-
Notifications
You must be signed in to change notification settings - Fork 428
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
fix(logs) logs should not color words with the ERR substring #1350
Conversation
73563de
to
564e54d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! I believe this can fix the issue for now but in the long run we might still have similar problems if there's any keyword containing "fatal" or something else that will be colored unexpectedly. Would you mind taking a different route like preventing any keyword with substring fatalCodes
to be colored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Thank you so much for contributing!
words := strings.Split(message, " ") | ||
for i, word := range words { | ||
if word == code { | ||
words[i] = givenColor.Sprint(word) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, looks like this ERR: ....
error message could not be shown with ERR
to be in red right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can make use of regex to do this matching stuff https://play.golang.org/p/uPTVbBXzXFz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks for all the feedback @iamhopaul123 and including a snippet of the regex!
…g codes in Event messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thank you!
Addresses aws#1312 Removes the element `ERR` from the `fatalCodes` slice This ensures that any Event struct containing the substring "ERR" will no longer be color-coded. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Addresses #1312
Removes the element
ERR
from thefatalCodes
sliceThis ensures that any Event struct containing the substring "ERR" will no longer be color-coded.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.