mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-05-06 03:45:32 +00:00
setup the debug function
This commit is contained in:
parent
e3d15ef4e7
commit
04e45f503b
2 changed files with 34 additions and 20 deletions
|
|
@ -180,29 +180,22 @@
|
|||
#define NDPI_SOULSEEK_CONNECTION_IP_TICK_TIMEOUT 600
|
||||
|
||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
|
||||
#define NDPI_LOG(proto, m, 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__; \
|
||||
if (mod->ndpi_debug_printf != NULL) \
|
||||
mod->ndpi_debug_printf(proto, mod, log_level, args); \
|
||||
else \
|
||||
printf(args, proto, mod, log_level); \
|
||||
} \
|
||||
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); \
|
||||
} \
|
||||
}
|
||||
|
||||
#else /* NDPI_ENABLE_DEBUG_MESSAGES */
|
||||
|
||||
#ifdef WIN32
|
||||
#define NDPI_LOG(...) {}
|
||||
#else
|
||||
#define NDPI_LOG(proto, mod, log_level, args...) {}
|
||||
#endif
|
||||
|
||||
#endif /* NDPI_ENABLE_DEBUG_MESSAGES */
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue