*** empty log message ***
authorMatthew Mondor <mmondor@pulsar-zone.net>
Wed, 21 Sep 2005 10:33:59 +0000 (10:33 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Wed, 21 Sep 2005 10:33:59 +0000 (10:33 +0000)
mmsoftware/mmlib/mmlog.c
mmsoftware/mmlib/mmlog.h

index 4fcd201..1cf2ebe 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mmlog.c,v 1.5 2004/03/22 06:59:35 mmondor Exp $ */
+/* $Id: mmlog.c,v 1.6 2005/09/21 10:33:59 mmondor Exp $ */
 
 /*
  * Copyright (C) 2000-2004, Matthew Mondor
@@ -39,6 +39,7 @@
 #include <sys/types.h>
 #include <syslog.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <stdarg.h>
 
 #include <mmtypes.h>
@@ -49,7 +50,7 @@
 
 MMCOPYRIGHT("@(#) Copyright (c) 2000-2004\n\
 \tMatthew Mondor. All rights reserved.\n");
-MMRCSID("$Id: mmlog.c,v 1.5 2004/03/22 06:59:35 mmondor Exp $");
+MMRCSID("$Id: mmlog.c,v 1.6 2005/09/21 10:33:59 mmondor Exp $");
 
 
     
@@ -81,4 +82,18 @@ mmdebug(const char *file, const char *func, int line, const char *fmt, ...)
     va_end(lst);
     syslog(LOG_NOTICE, "%s:%s():%d - %s", file, func, line, buf);
 }
+
+void
+mmdebug2(const char *file, const char *func, int line, const char *fmt, ...)
+{
+    va_list lst;
+    char buf[1024];
+
+    va_start(lst, fmt);
+    vsnprintf(buf, 1023, fmt, lst);
+    va_end(lst);
+    syslog(LOG_NOTICE, "%s:%s():%d - %s", file, func, line, buf);
+
+    abort();
+}
 #endif
index 65056ed..250359d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mmlog.h,v 1.15 2004/06/17 13:20:12 mmondor Exp $ */
+/* $Id: mmlog.h,v 1.16 2005/09/21 10:33:59 mmondor Exp $ */
 
 /*
  * Copyright (C) 2000-2004, Matthew Mondor
 /* Macro similar to assert(3) but which does not exit the application. Will
  * instead log the condition.
  */
+#ifdef DEBUG_ASSERT_ABORT
+#define DEBUG_ASSERT(c)                if (!(c)) \
+    mmdebug2(__FILE__, __func__, __LINE__, "DEBUG_ASSERT(" #c ") == %d", c);
+#else
 #define DEBUG_ASSERT(c)                if (!(c)) \
     mmdebug(__FILE__, __func__, __LINE__, "DEBUG_ASSERT(" #c ") == %d", c);
+#endif
 
 #else