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

no-color compliant #10

Closed
MarAvFe opened this issue Mar 3, 2020 · 2 comments
Closed

no-color compliant #10

MarAvFe opened this issue Mar 3, 2020 · 2 comments

Comments

@MarAvFe
Copy link

MarAvFe commented Mar 3, 2020

Would you consider implementing no-color?

I could create a PR if you did.

I ran into this while trying to pipe fblog output through less and getting something not as friendly

ESC[1m2020-03-02T22:45:22ESC[0m ESC[1;31mERROR:ESC[0m Failed to send sms
ESC[1;38;2;150;150;150m                     body:ESC[0m ID: 19169 Status: 1
ESC[1;38;2;150;150;150m                     file:ESC[0m my/path/file.go:194
ESC[1;38;2;150;150;150m                     func:ESC[0m other/path.monitorMsgID
ESC[1;38;2;150;150;150m                    level:ESC[0m error
ESC[1;38;2;150;150;150m                      msg:ESC[0m Failed to send sms
ESC[1;38;2;150;150;150m                  request:ESC[0m http://localhost/query
ESC[1;38;2;150;150;150m                     time:ESC[0m 2020-03-02T22:45:22Z
ESC[1m2020-03-02T22:45:22ESC[0m ESC[1;31mERROR:ESC[0m Failed to send sms
ESC[1;38;2;150;150;150m                    error:ESC[0m [{other/path/file.go:103: } {other/path/file.go:190: Failed to send sms}]
ESC[1;38;2;150;150;150m                     file:ESC[0m my/path/file.go:106
ESC[1;38;2;150;150;150m                     func:ESC[0m other/path.(*smsClient).Send
ESC[1;38;2;150;150;150m                    level:ESC[0m error
ESC[1;38;2;150;150;150m                      msg:ESC[0m Failed to send sms```
@bomgar
Copy link
Member

bomgar commented Mar 4, 2020

Sure. Sounds like a good thing to have.

btw less can actually show colors. I can't test it at the moment but i think it was -r. fblog could detect if the output is a tty or not and disable colors automatically but this would prevent users from using less with color.

@bomgar
Copy link
Member

bomgar commented Mar 4, 2020

I could create a PR if you did.

that would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants