From dfe85ca516c207eadc4ae77066c6706f17068f20 Mon Sep 17 00:00:00 2001 From: Loïc Collignon Date: Mon, 22 Oct 2018 16:44:03 +0200 Subject: Added an option to color out the ouput MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhance the readability using basic colorization to the logging system. As the '--call' option is almost unused, it doesn't require to have a shortname. So we use the '-c' and '--color' for the new colorization option, and keep only the longname for the 'call' option. Change-Id: I095fc9f38133fb742e0f0003540cd120feec8f5e Signed-off-by: Loïc Collignon --- src/verbose.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/verbose.h') diff --git a/src/verbose.h b/src/verbose.h index bd36f97e..183932bb 100644 --- a/src/verbose.h +++ b/src/verbose.h @@ -109,6 +109,8 @@ extern void verbose_inc(); extern void verbose_clear(); extern void verbose_add(int level); extern void verbose_sub(int level); +extern void verbose_colorize(); +extern int verbose_is_colorized(); extern int verbose_level_of_name(const char *name); extern const char *verbose_name_of_level(int level); @@ -120,3 +122,15 @@ extern void verbosity_set(int verbo); extern int verbosity_from_mask(int mask); extern int verbosity_to_mask(int verbo); +#define COLOR_EMERGENCY "\x1B[101m" +#define COLOR_ALERT "\x1B[43m" +#define COLOR_CRITICAL "\x1B[41m" +#define COLOR_ERROR "\x1B[91m" +#define COLOR_WARNING "\x1B[93m" +#define COLOR_NOTICE "\x1B[94m" +#define COLOR_INFO "\x1B[96m" +#define COLOR_DEBUG "\x1B[95m" +#define COLOR_API "\x1B[1m" +#define COLOR_FILE "\x1B[90m" +#define COLOR_DEFAULT "\x1B[0m" + -- cgit 1.2.3-korg