]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/log.c
new Function: LogDebug()
[ngircd-alex.git] / src / ngircd / log.c
index a29c40154d524113d46f4555090609e7248abdb2..396555ee73555e84fb58e4d85b7a779b450ca3b9 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: log.c,v 1.59 2005/08/29 10:58:00 alex Exp $";
+static char UNUSED id[] = "$Id: log.c,v 1.60 2006/02/08 17:33:28 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -162,6 +162,35 @@ Log_Exit( void )
 } /* Log_Exit */
 
 
+# ifdef PROTOTYPES
+GLOBAL void
+LogDebug( const char *Format, ... )
+# else
+GLOBAL void
+LogDebug( Format, va_alist )
+const char *Format;
+va_dcl
+# endif
+#ifdef DEBUG
+{
+       char msg[MAX_LOG_MSG_LEN];
+       va_list ap;
+
+       if (!NGIRCd_Debug) return;
+#ifdef PROTOTYPES
+       va_start( ap, Format );
+#else
+       va_start( ap );
+#endif
+       vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
+       va_end( ap );
+       Log(LOG_DEBUG, "%s", msg);
+}
+#else
+{ /* do nothing */ }
+#endif /* DEBUG */
+
+       
 #ifdef PROTOTYPES
 GLOBAL void
 Log( int Level, const char *Format, ... )
@@ -174,7 +203,6 @@ va_dcl
 #endif
 {
        /* Eintrag in Logfile(s) schreiben */
-
        char msg[MAX_LOG_MSG_LEN];
        bool snotice;
        va_list ap;