How to have colours for log levels, errors analysis in the Harness console in NextGen

This topic walks you through the steps to follow to have colours for log levels, and errors analysis in the Harness console in NextGen

Use case :

Is it possible to have the Harness console show colours when you run Junit tests via maven same as in, say IntelliJ editor or terminal (iTerm)?

echo "\033[35mSkipping building JARs for optimization master branch, just downloading them from Artifactory!\033[0m"

It would be helpful if we could have colours for log levels and error analysis in the Harness console.

Steps to achieve this use case:

  1. Harness logs viewer uses ANSI escape code. This is the same standard used by bash and other terminal software.

  2. We should be able to retain colours if the tool emits coloured output. Sample screenshot from Harness pipeline log:

  3. You can achieve this with No config changes. Just use any binary/tool which is expected to emit coloured logs.

  4. For example, the maven parameter -Dstyle.color=always will help you to add colours for log levels and error analysis in the Harness console.

These are the steps we need to follow to have colours for log levels and error analysis in the Harness console in NextGen.

3 Likes