Bash formatting in log files
Answered
I've created a bash script that runs some tests for me and writes the output to a log file. I've added some bash-style formatting to some of the more important results (success/fail) which works very well in the shell. For deeper analysis I've used IntelliJ to view the resulting log file but there the formatting is lost, for example a light blue "Building..." becomes "[1;34mBuilding".
Is there some plugin or script that would enable me to add this functionality? The only reference to a similar problem I found is this one: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206603185-Fonts-and-colors?input_string=Log%20file%20colors
Please sign in to leave a comment.
IDE would need a special file type to interpret and display the ANSI colors. It's supported for several console types and terminals, but there is no special file type to handle it.
Feature request is welcome at https://youtrack.jetbrains.com/issues/IDEA.
I'm sorry, I don't quite understand. By "it's supported for several console types and terminals" do you mean that the support exists in other terminals or that the support exists in IntelliJ?
Also a side question, is there some way to tell IntelliJ "whenever you see this exact text string format it in this way". I'm fine with it happening across all file types (though being able to restrict it to file type wouldn't hurt).
Support in IntelliJ IDEA exists for the consoles and the terminal, but it's added explicitly depending on the run/debug configuration type. See https://youtrack.jetbrains.com/issue/IDEA-69880 that was fixed some time ago.
> "whenever you see this exact text string format it in this way"
Might be possible via the language injection, but the special language plug-in (file type) would be needed to handle it anyway.
Feature request: https://youtrack.jetbrains.com/issue/IDEA-172142.