[Pcsclite-cvs-commit] r2400 - trunk/PCSC/src

Ludovic Rousseau rousseau at alioth.debian.org
Sat Feb 17 16:04:03 CET 2007


Author: rousseau
Date: 2007-02-17 16:04:03 +0100 (Sat, 17 Feb 2007)
New Revision: 2400

Modified:
   trunk/PCSC/src/debuglog.c
Log:
add a log_line() function and use it form log_msg() and log_xxd() to
also have colors in log_xxd()


Modified: trunk/PCSC/src/debuglog.c
===================================================================
--- trunk/PCSC/src/debuglog.c	2007-02-17 14:56:45 UTC (rev 2399)
+++ trunk/PCSC/src/debuglog.c	2007-02-17 15:04:03 UTC (rev 2400)
@@ -47,6 +47,8 @@
 
 static signed char LogDoColor = 0;	/* no color by default */
 
+static void log_line(const int priority, const char *DebugBuffer);
+
 void log_msg(const int priority, const char *fmt, ...)
 {
 	char DebugBuffer[DEBUG_BUF_SIZE];
@@ -69,6 +71,11 @@
 #endif
 	va_end(argptr);
 
+	log_line(priority, DebugBuffer);
+} /* log_msg */
+
+static void log_line(const int priority, const char *DebugBuffer)
+{
 #ifndef WIN32
 	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);
@@ -135,12 +142,7 @@
 	if ((c >= debug_buf_end) && (i < len))
 		c[-3] = c[-2] = c[-1] = '.';
 
-#ifndef WIN32
-	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
-		syslog(LOG_INFO, "%s", DebugBuffer);
-	else
-#endif
-		fprintf(stderr, "%s\n", DebugBuffer);
+	log_line(priority, DebugBuffer);
 } /* log_xxd */
 
 #ifdef PCSCD




More information about the Pcsclite-cvs-commit mailing list