aboutsummaryrefslogtreecommitdiff
path: root/src/include/ndpi_define.h
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2016-11-03 15:39:28 +0100
committerCampus <campus@ntop.org>2016-11-03 15:39:28 +0100
commit58e97c966c3aef178580d8f362df95274fbe9c8a (patch)
tree2276b88ff75811e44d48336c3ee4d1303e297940 /src/include/ndpi_define.h
parent002b8b04e9ff06aa75a93af4466361636ef38820 (diff)
parente3d15ef4e7f896ca62773cbd9b207967055d96b0 (diff)
Merge branch 'vpiserchia-dev' into dev
Diffstat (limited to 'src/include/ndpi_define.h')
-rw-r--r--src/include/ndpi_define.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/ndpi_define.h b/src/include/ndpi_define.h
index cc237128a..ce6149e5e 100644
--- a/src/include/ndpi_define.h
+++ b/src/include/ndpi_define.h
@@ -181,13 +181,17 @@
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
-#define NDPI_LOG(proto, mod, log_level, args...) \
+#define NDPI_LOG(proto, m, log_level, args...) \
{ \
+ struct ndpi_detection_module_struct *mod = (struct ndpi_detection_module_struct*) m; \
if(mod != NULL) { \
mod->ndpi_debug_print_file=__FILE__; \
mod->ndpi_debug_print_function=__FUNCTION__; \
mod->ndpi_debug_print_line=__LINE__; \
- mod->ndpi_debug_printf(proto, mod, log_level, args); \
+ if (mod->ndpi_debug_printf != NULL) \
+ mod->ndpi_debug_printf(proto, mod, log_level, args); \
+ else \
+ printf(args, proto, mod, log_level); \
} \
}