From: George Joseph Date: Thu, 17 Sep 2020 16:40:39 +0000 (-0600) Subject: logger.h: Fix ast_trace to respect scope_level X-Git-Tag: 18.1.0-rc1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99bd7d95de54cf23446050435024295743be329c;p=thirdparty%2Fasterisk.git logger.h: Fix ast_trace to respect scope_level ast_trace() was always emitting messages when it's level was set to -1 because it was ignoring scope_level. Change-Id: I849c8f4f4613899c37f82be0202024e7d117e506 --- diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index 72c938d3de..6ab55f76da 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -663,7 +663,7 @@ void __attribute__((format (printf, 6, 7))) __ast_trace(const char *file, int li */ #define ast_trace_raw(level, indent_type, ...) \ ast_debug(level < 0 ? __scope_level : level, " " __VA_ARGS__); \ - if (TRACE_ATLEAST(level)) { \ + if (TRACE_ATLEAST(level < 0 ? __scope_level : level)) { \ __ast_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, indent_type, 0, " " __VA_ARGS__); \ } @@ -678,7 +678,7 @@ void __attribute__((format (printf, 6, 7))) __ast_trace(const char *file, int li */ #define ast_trace(level, ...) \ ast_debug(level < 0 ? __scope_level : level, " " __VA_ARGS__); \ - if (TRACE_ATLEAST(level)) { \ + if (TRACE_ATLEAST(level < 0 ? __scope_level : level)) { \ __ast_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, AST_TRACE_INDENT_SAME, 0, " " __VA_ARGS__); \ }