How do I "echo" a log message with a color?

Colored output from eg testing frameworks etc. works fine, but things I echo from my make file rules don’t. For example, consider

       @echo "$(ccso)$(ccgreen)Finished unit tests of console app$(ccend)"

where

ccend = $(shell tput sgr0)
ccbold = $(shell tput bold)
ccgreen = $(shell tput setaf 2)
ccso = $(shell tput smso)

These colorings work fine on my local terminal. In CI log output, they seem to be being ignored completely.

1 Like