support text coloring in jenkins console output

9,137 views
Skip to first unread message

Eyal Edri

unread,
Jul 19, 2011, 10:27:42 AM7/19/11
to jenkins...@googlegroups.com
Is it possible to support text coloring in Jenkins console output, similar
to a linux console?

When you print specific chars in a linux console, it colors them, can
Jenkins support this?

#text colors
RED="\033[0;31m"
GREEN="\033[92m"
BLUE="\033[94m"
YELLOW="\033[93m"
NO_COLOR="\033[0m"

Eyal.

Andreas Schilling

unread,
Jul 19, 2011, 10:36:18 AM7/19/11
to jenkins...@googlegroups.com
hi Eyal!

afaik this is not possible in this very generic way you are describing.
however, if you are planning to use this to tag warning/info/error outputs in your log, then maybe this plugin is what you need:
https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin

regards,

Andreas Schilling
CAE Processes & Data Management
-------------------------------------------------------------------
Dipl. Inf. Andreas Schilling
Senior Software Architect

TWT GmbH
Science & Innovation
Bernhäuser Str. 40 - 42
73765 Neuhausen

Tel: +49 - 7158 - 17 15 - 673
E-Mail: andreas....@twt-gmbh.de
--------------------------------------------------------------------
www.twt-gmbh.de
--------------------------------------------------------------------
Geschäftsführung: Dimitrios Vartziotis, Joachim Laicher (stv.)
Registergericht: Amtsgericht Stuttgart, HRB Nr. 212778
Umsatzsteuer: ID-Nr.: DE147841145
--------------------------------------------------------------------

Slide

unread,
Jul 19, 2011, 10:46:45 AM7/19/11
to jenkins...@googlegroups.com

Also, if you are wanting to do this in the emails, I just added a simple check in the html.jelly file for if a line contains "warning:" etc and added a color changing tag around that output in the html email.

Pooja Shah

unread,
May 4, 2016, 3:36:35 AM5/4/16
to Jenkins Users, ee...@redhat.com
This answer may not be relevant now, but to save newbie's time, its https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin what does it exactly. But user's code should have these color codes which might not be acceptable for few then should for https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin
Reply all
Reply to author
Forward
0 new messages