]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
add DAPL_DBG_LEVEL for more debug log control
authorArlin Davis <arlin.r.davis@intel.com>
Thu, 20 Jun 2013 18:10:54 +0000 (11:10 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Thu, 20 Jun 2013 18:10:54 +0000 (11:10 -0700)
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dapl/common/dapl_debug.c
dapl/include/dapl_debug.h

index 7966ddf18c0d6ad98debbc777228f2fef2744ba7..c8393c3d1af844d76681bf52285d9c85672c8247 100644 (file)
@@ -31,6 +31,7 @@
 #include <stdlib.h>
 #endif                         /* __KDAPL__ */
 
+DAPL_DBG_TYPE g_dapl_dbg_level;        /* debug type override */
 DAPL_DBG_TYPE g_dapl_dbg_type; /* initialized in dapl_init.c */
 DAPL_DBG_DEST g_dapl_dbg_dest; /* initialized in dapl_init.c */
 int          g_dapl_dbg_mem;   /* initialized in dapl_init.c */
@@ -51,7 +52,7 @@ void dapl_internal_dbg_log(DAPL_DBG_TYPE type, const char *fmt, ...)
                last_t = start_t;
        }
 
-       if (type & g_dapl_dbg_type) {
+       if ((type & g_dapl_dbg_type) || (type & g_dapl_dbg_level)) {
                if (DAPL_DBG_DEST_STDOUT & g_dapl_dbg_dest) {
                        dapl_os_get_time(&current_t);
                        delta_t = current_t - last_t;
index 0c4de0e9f314079fa29bbf88e8beb818f7dbc77e..f1d80a541d2705f7d6eeed521d7ca01ba335bef7 100644 (file)
@@ -88,16 +88,17 @@ typedef enum
     DAPL_DBG_DEST_SYSLOG       = 0x0002,
 } DAPL_DBG_DEST;
 
+extern DAPL_DBG_TYPE   g_dapl_dbg_level;
 extern DAPL_DBG_TYPE   g_dapl_dbg_type;
 extern DAPL_DBG_DEST   g_dapl_dbg_dest;
 extern int             g_dapl_dbg_mem;
 
 extern void dapl_internal_dbg_log(DAPL_DBG_TYPE type,  const char *fmt,  ...);
 
-#define dapl_log g_dapl_dbg_type==0 ? (void) 1 : dapl_internal_dbg_log
+#define dapl_log g_dapl_dbg_level==0 ? (void) 1 : dapl_internal_dbg_log
 
 #if defined(DAPL_DBG)
-#define dapl_dbg_log g_dapl_dbg_type==0 ? (void) 1 : dapl_internal_dbg_log
+#define dapl_dbg_log g_dapl_dbg_level==0 ? (void) 1 : dapl_internal_dbg_log
 #else
 #define dapl_dbg_log(...)
 #endif