Merge remote-tracking branch 'origin/topic/bbannier/debug_logger_lookup'

* origin/topic/bbannier/debug_logger_lookup:
  Find correct zeek namespace in debug logger macros.
This commit is contained in:
Tim Wojtulewicz 2020-11-30 14:07:39 -07:00
commit 616d29c08d
3 changed files with 19 additions and 8 deletions

11
CHANGES
View file

@ -1,3 +1,14 @@
3.3.0-dev.580 | 2020-11-30 14:07:39 -0700
* Find correct zeek namespace in debug logger macros.
These macros forward to functionality in `zeek::detail::debug_logger`
and are not intended for customization. This patch fixes the macros to
always use `::zeek::detail::debug_logger` as without the leading `::`
lookup could happen in any potentially local namespace `zeek` which does
not need to provide this symbol.
This closes zeek/spicy#597. (Benjamin Bannier, Corelight)
3.3.0-dev.576 | 2020-11-26 18:16:07 +0000

View file

@ -1 +1 @@
3.3.0-dev.576
3.3.0-dev.580

View file

@ -12,15 +12,15 @@
#include <set>
#define DBG_LOG(stream, args...) \
if ( zeek::detail::debug_logger.IsEnabled(stream) ) \
zeek::detail::debug_logger.Log(stream, args)
if ( ::zeek::detail::debug_logger.IsEnabled(stream) ) \
::zeek::detail::debug_logger.Log(stream, args)
#define DBG_LOG_VERBOSE(stream, args...) \
if ( zeek::detail::debug_logger.IsVerbose() && zeek::detail::debug_logger.IsEnabled(stream) ) \
zeek::detail::debug_logger.Log(stream, args)
#define DBG_PUSH(stream) zeek::detail::debug_logger.PushIndent(stream)
#define DBG_POP(stream) zeek::detail::debug_logger.PopIndent(stream)
if ( ::zeek::detail::debug_logger.IsVerbose() && ::zeek::detail::debug_logger.IsEnabled(stream) ) \
::zeek::detail::debug_logger.Log(stream, args)
#define DBG_PUSH(stream) ::zeek::detail::debug_logger.PushIndent(stream)
#define DBG_POP(stream) ::zeek::detail::debug_logger.PopIndent(stream)
#define PLUGIN_DBG_LOG(plugin, args...) zeek::detail::debug_logger.Log(plugin, args)
#define PLUGIN_DBG_LOG(plugin, args...) ::zeek::detail::debug_logger.Log(plugin, args)
ZEEK_FORWARD_DECLARE_NAMESPACED(Plugin, zeek, plugin);