aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-export.c
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2018-10-22 16:44:03 +0200
committerLoïc Collignon <loic.collignon@iot.bzh>2018-10-23 11:56:42 +0200
commitdfe85ca516c207eadc4ae77066c6706f17068f20 (patch)
tree07f0b87dd8d7da0b60ad12fefee5253ab511cfa4 /src/afb-export.c
parent61a01510306f60422df3cd3e67513d3c7b585524 (diff)
Added an option to color out the ouput
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 <loic.collignon@iot.bzh>
Diffstat (limited to 'src/afb-export.c')
-rw-r--r--src/afb-export.c2
1 files changed, 1 insertions, 1 deletions
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);
}
}