Having problems to see the colors for logs on the IntelliJ Run Console (windows).
Through Cygwin run, I see logs have different colors, e.g:
On the IntelliJ run Console, same logs show without any colors:
For the terminal, we can use %s and \x1b to print colored logs. Notice the %s in the first argument string. This is where the second argument (the string we want to print) will be injected. The first half of the string (before the %s ) is: \x1b[33m .
Add a log In the run/debug configuration that will be used for launching the app, click Modify options. From the menu, select Specify logs to be shown in console. In the table that opens, click Add. Specify the log Alias (the name that will be displayed in the tool window tabs) and the path to the log file.
The GrepConsole plugin for IntelliJ supports something like this.
Here's some console output with no use of GrepConsole:
And here's the same console output again but with GrepConsole configured to render lines containing INFO
in green and lines containing ERROR
in red:
Here's the GrepConsole configuration:
Note: this does not exactly match what you asked for (highlighting a single word) but it's close and configuring GrepConsole for this behavour is very simple and GrepConsole also offers other useful features such a searching and filtering the console output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With