mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Improve DBG_LOG macro (perf. improvement for --enable-debug mode).
Many usages of this macro do some string formatting work inline in the arguments that end up being unnecessary because the debug stream is disabled.
This commit is contained in:
parent
4fd1098949
commit
302c063874
1 changed files with 6 additions and 4 deletions
|
@ -33,10 +33,12 @@ enum DebugStream {
|
|||
NUM_DBGS // Has to be last
|
||||
};
|
||||
|
||||
#define DBG_LOG(args...) debug_logger.Log(args)
|
||||
#define DBG_LOG_VERBOSE(args...) \
|
||||
if ( debug_logger.IsVerbose() ) \
|
||||
debug_logger.Log(args)
|
||||
#define DBG_LOG(stream, args...) \
|
||||
if ( debug_logger.IsEnabled(stream) ) \
|
||||
debug_logger.Log(stream, args)
|
||||
#define DBG_LOG_VERBOSE(stream, args...) \
|
||||
if ( debug_logger.IsVerbose() && debug_logger.IsEnabled(stream) ) \
|
||||
debug_logger.Log(stream, args)
|
||||
#define DBG_PUSH(stream) debug_logger.PushIndent(stream)
|
||||
#define DBG_POP(stream) debug_logger.PopIndent(stream)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue