[Pommed-commits] r470 - trunk/pommed

jblache at alioth.debian.org jblache at alioth.debian.org
Sun May 25 10:55:24 UTC 2008


Author: jblache
Date: 2008-05-25 10:55:21 +0000 (Sun, 25 May 2008)
New Revision: 470

Modified:
   trunk/pommed/pommed.c
Log:
Log *all* the pieces at the same place.


Modified: trunk/pommed/pommed.c
===================================================================
--- trunk/pommed/pommed.c	2008-05-25 10:52:29 UTC (rev 469)
+++ trunk/pommed/pommed.c	2008-05-25 10:55:21 UTC (rev 470)
@@ -335,6 +335,7 @@
 logmsg(int level, char *fmt, ...)
 {
   va_list ap;
+  FILE *where = stdout;
 
   va_start(ap, fmt);
 
@@ -343,22 +344,23 @@
       switch (level)
 	{
 	  case LOG_INFO:
-	    fprintf(stdout, "I: ");
+	    fprintf(where, "I: ");
 	    break;
 
 	  case LOG_WARNING:
-	    fprintf(stdout, "W: ");
+	    fprintf(where, "W: ");
 	    break;
 
 	  case LOG_ERR:
-	    fprintf(stderr, "E: ");
+	    where = stderr;
+	    fprintf(where, "E: ");
 	    break;
 
 	  default:
 	    break;
 	}
-      vfprintf(stdout, fmt, ap);
-      fprintf(stdout, "\n");
+      vfprintf(where, fmt, ap);
+      fprintf(where, "\n");
     }
   else
     {




More information about the Pommed-commits mailing list