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/afb-export.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/afb-export.c') diff --git a/src/afb-export.c b/src/afb-export.c index fdd4573f..fb1888ed 100644 --- a/src/afb-export.c +++ b/src/afb-export.c @@ -274,7 +274,7 @@ static void vverbose_cb(struct afb_api_x3 *closure, int level, const char *file, if (!fmt || vasprintf(&p, fmt, args) < 0) vverbose(level, file, line, function, fmt, args); else { - verbose(level, file, line, function, "[API %s] %s", export->api.apiname, p); + verbose(level, file, line, function, (verbose_is_colorized() == 0 ? "[API %s] %s" : COLOR_API "[API %s]" COLOR_DEFAULT " %s"), export->api.apiname, p); free(p); } } -- cgit 1.2.3-korg