colourize warnings and errors

Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Simon Gomizelj 2013-03-01 14:56:18 -05:00 committed by Allan McRae
parent e8130b8f2c
commit 5dada13a1a

View file

@ -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: ");