-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add ability to read ANSI escape codes from logs #57
Comments
Thanks for this suggestion. I have actually never seen a log file like that and I'm not sure of how it could be implemented. But I'll leave the issue open so that someone can contribute if they think of a good solution to this problem. |
@emilast There is are some reasons why you didn't see it:
For browsers there are extensions that can render ANSI escaped text files. As far as I know, no browser has native support for ANSI escaped files. Apparently there is one ATOM extension that is able to do this, see https://atom.io/packages/language-ansi-styles |
I would love to see this. Our product has |
This please. A lot of the hard work differentiating parts of the log is done with ansi colour codes. Just need to colour based on the ansi encoding. Im getting this a lot from my docker-compose logs For example the following log should have the name of the service coloured based on [32 -> [36
|
Some commands allow you to test this by explicitly enabling the color escapes.
instead of
|
@ArtemGr Most tools are smart enough to disable ANSI sequences when the output is not a TTY (file redirection being such example). Still there are cases where ANSI enabled if forcebly enabled even if the stdout is not a tty and good example is usually a CI system that has an ANSI enabled console. I personally would find very useful to be able to read ANSI logs. If there are any concerns about backwards compatibility this feature could be made optional. |
There's no extension in the VS Code marketplace (from what I can find) that does highlighting for ANSI color codes. This extension seems to be the most relevant though; it would be a killer feature for me! |
Maybe this help (set file type at right bottom as |
Thanks @foton that really helps :). That's exactly what I'd love this extension to do. I would say such a features falls in the area of working with log files in a better way. Perhaps it could even by done by default when detecting some ANSI codes, or by way of configuration. In any case, the extension @foton found could perhaps be a source of inspiration for adding this feature in this one. https://github.com/TobiasFaller/vscode-vt100-syntax-highlight |
I'd say it's pretty common for logs to include some Ansi color codes (in particular unit test outputs). Kind of surprised to see it wasn't already supported (since standard bash tools like Less already do with |
There is now a very nice extension to do this. And don't forget to open the preview or run the preview command to actually view it correctly! |
@nam20485, thank you for mentioning this other extension. I will close this issue now that there is a solution for showing ANSI colors. |
Some logs files already have ANSI coloring on them and it would be great it this extension would be able to deal with them instead of displaying the ugly ANSI escapes.
The text was updated successfully, but these errors were encountered: