From 5dada13a1a5d8cc6edccf74f80d7e445467cd5f5 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Fri, 1 Mar 2013 14:56:18 -0500 Subject: colourize warnings and errors Signed-off-by: Simon Gomizelj Signed-off-by: Allan McRae --- src/pacman/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/util.c b/src/pacman/util.c index d503073a..4dd0acad 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -1668,10 +1668,12 @@ int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list /* print a prefix to the message */ switch(level) { case ALPM_LOG_ERROR: - fprintf(stream, _("error: ")); + fprintf(stream, "%s%s%s", config->colstr.err, _("error: "), + config->colstr.nocolor); break; case ALPM_LOG_WARNING: - fprintf(stream, _("warning: ")); + fprintf(stream, "%s%s%s", config->colstr.warn, _("warning: "), + config->colstr.nocolor); break; case ALPM_LOG_DEBUG: fprintf(stream, "debug: "); -- cgit v1.2.3-70-g09d2