diff --git a/debian/libwsutil0.symbols b/debian/libwsutil0.symbols index 22e98365f8..7ef14ee6d2 100644 --- a/debian/libwsutil0.symbols +++ b/debian/libwsutil0.symbols @@ -356,6 +356,7 @@ libwsutil.so.0 libwsutil0 #MINVER# ws_log_set_fatal_str@Base 3.5.0 ws_log_set_level@Base 3.5.0 ws_log_set_level_str@Base 3.5.0 + ws_log_write_always_full@Base 3.5.0 ws_logv@Base 3.5.0 ws_logv_full@Base 3.5.0 ws_mempbrk_compile@Base 1.99.4 diff --git a/epan/crypt/dot11decrypt_debug.h b/epan/crypt/dot11decrypt_debug.h index 2dd15ab72b..ba43af19de 100644 --- a/epan/crypt/dot11decrypt_debug.h +++ b/epan/crypt/dot11decrypt_debug.h @@ -27,7 +27,7 @@ debug_dump(const char *file, int line, const char* func, if (!ws_log_msg_is_active(WS_LOG_DOMAIN, level)) return; char* tmp_str = bytes_to_str(NULL, y, (z)); - ws_log_full(WS_LOG_DOMAIN, level, file, line, func, "%s: %s", x, tmp_str); + ws_log_write_always_full(WS_LOG_DOMAIN, level, file, line, func, "%s: %s", x, tmp_str); wmem_free(NULL, tmp_str); } diff --git a/wsutil/wslog.c b/wsutil/wslog.c index 2c7cef99ae..d6442c61dc 100644 --- a/wsutil/wslog.c +++ b/wsutil/wslog.c @@ -896,6 +896,18 @@ void ws_log_full(const char *domain, enum ws_log_level level, } +void ws_log_write_always_full(const char *domain, enum ws_log_level level, + const char *file, int line, const char *func, + const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + log_write_dispatch(domain, level, file, line, func, format, ap); + va_end(ap); +} + + void ws_log_default_writer(const char *domain, enum ws_log_level level, ws_log_time_t timestamp, const char *file, int line, const char *func, diff --git a/wsutil/wslog.h b/wsutil/wslog.h index 65d0db4385..f656d4fb22 100644 --- a/wsutil/wslog.h +++ b/wsutil/wslog.h @@ -296,6 +296,19 @@ void ws_logv_full(const char *domain, enum ws_log_level level, #define ws_noisy(...) _LOG_DEBUG(LOG_LEVEL_NOISY, __VA_ARGS__) +/** Auxiliary function to write custom logging functions. + * + * This function is the same as ws_log_full() but does not perform any + * domain/level filtering to avoid a useless double activation check. + * It should only be used in conjunction with a pre-check using + * ws_log_msg_is_active(). + */ +WS_DLL_PUBLIC +void ws_log_write_always_full(const char *domain, enum ws_log_level level, + const char *file, int line, const char *func, + const char *format, ...) G_GNUC_PRINTF(6,7); + + /** Define an auxiliary file pointer where messages should be written. * * This file, if set, functions in addition to the registered or