[pacman-dev] [PATCH 09/15] colourize warnings and errors

Simon Gomizelj simongmzlj at gmail.com
Wed Mar 6 12:51:50 EST 2013


Signed-off-by: Simon Gomizelj <simongmzlj at gmail.com>
---
 src/pacman/util.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index bbc2d88..e94b6ad 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1669,10 +1669,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: ");
-- 
1.8.1.5



More information about the pacman-dev mailing list