[Asterisk-code-review] logger.h: Fix ast_trace to respect scope_level (asterisk[17])

George Joseph asteriskteam at digium.com
Tue Sep 22 09:54:24 CDT 2020


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14963 )

Change subject: logger.h: Fix ast_trace to respect scope_level
......................................................................

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
---
M include/asterisk/logger.h
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index 72c938d..6ab55f7 100644
--- a/include/asterisk/logger.h
+++ b/include/asterisk/logger.h
@@ -663,7 +663,7 @@
  */
 #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 @@
  */
 #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__); \
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14963
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: I849c8f4f4613899c37f82be0202024e7d117e506
Gerrit-Change-Number: 14963
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200922/98478196/attachment.html>


More information about the asterisk-code-review mailing list