-
Notifications
You must be signed in to change notification settings - Fork 95
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
Log with color to file #251
Comments
I wonder if |
Thanks!! Looking at the source it doesn't look like there's a way to force color. Colors are appended in the |
Hi! I'm running under supervisord a binary that logs colored output, but the log files are not colored. My guess is that slog detects that the output is not being sent to stdout and chooses not to log with colors. Having the option to force color would solve this. |
On Linux the color is achieved by outputting VT100 escape sequences. Most text editors will not actually display colors when you open a file with these sequences. You'll just see the output inter-winded with bunch of garbage. Just setting the expectations right. :) |
In my particular case, the logs are so huge that I don't even open them with an editor - all reading is done with tools like
That said, I think it would be a good idea to add this remark to the documentation if the feature is implemented. |
Hey -- I was looking for this feature today. Not sure what the current status of this is, but I wanted to say that many non-terminal environments understand VT100 sequences (aka ANSI color codes) these days. An example is GitHub Actions CI. There are also semi-standard environment variables now understood, such as |
More a feature request than a bug, but it would be nice to have a way to log to a generic stream using the colors implemented in
slog_term::TermDecorator
. Right now you have to reimplement the entire thing to get terminal colors to log to a file.This is useful when logging to a file which is later
tail -F
'd.The text was updated successfully, but these errors were encountered: