[pacman-dev] Patch for pm_printf
Dan Campbell
dan.campbell at gmail.com
Tue Apr 7 15:30:23 EDT 2009
It doesn't do much, just checks the log level, and if set to debug or error,
prints to stderr instead of stdout. Not a pressing thing, but in my opinion
this makes more sense.
>From 6f0607564bc32291b5bab8e49a657f6f255dce93 Mon Sep 17 00:00:00 2001
From: Dan Campbell <dan at archbox.localdomain>
Date: Tue, 7 Apr 2009 19:00:51 -0500
Subject: [PATCH] Make pacman behave more like "standard" unix utilities by
printing
error and debug messages to stderr instead of stdout.
Signed-off-by: Dan Campbell <dan<dot>campbell at gmail<dot>com>
---
src/pacman/util.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/pacman/util.c b/src/pacman/util.c
index b80b09a..ebc5ff2 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -710,7 +710,11 @@ int pm_printf(pmloglevel_t level, const char *format,
...)
/* print the message using va_arg list */
va_start(args, format);
+ if(level == PM_LOG_DEBUG || level == PM_LOG_ERROR) {
+ ret = pm_vfprintf(stderr, level, format, args);
+ } else {
ret = pm_vfprintf(stdout, level, format, args);
+ }
va_end(args);
return(ret);
--
1.6.2.2
More information about the pacman-dev
mailing list