[asterisk-commits] logger: Bring back ability to turn debug on by source file (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 3 09:55:07 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6618 )

Change subject: logger:  Bring back ability to  turn debug on by source file
......................................................................

logger:  Bring back ability to  turn debug on by source file

Somewhere along the way we lost the ability to debug individual
source files.  For modules, this wasn't a big deal but all the
source files in ./main are in the one "core" module so debugging
individual core capabilities was almost impossible.

* Added a test to DEBUG_ATLEAST that also checks __FILE__ instead
of just module name.  Any source file will work even if it's in
a module subdirectory.

Change-Id: Icc0af41837f3b1679dec7af21fa32cd1f7469f6e
---
M include/asterisk/logger.h
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Corey Farrell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index 1a2bf90..e19ba94 100644
--- a/include/asterisk/logger.h
+++ b/include/asterisk/logger.h
@@ -447,7 +447,9 @@
 
 #define DEBUG_ATLEAST(level) \
 	(option_debug >= (level) \
-		|| (ast_opt_dbg_module && (int)ast_debug_get_by_module(AST_MODULE) >= (level)))
+		|| (ast_opt_dbg_module \
+        	&& ((int)ast_debug_get_by_module(AST_MODULE) >= (level) \
+				|| (int)ast_debug_get_by_module(__FILE__) >= (level))))
 
 /*!
  * \brief Log a DEBUG message

-- 
To view, visit https://gerrit.asterisk.org/6618
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Icc0af41837f3b1679dec7af21fa32cd1f7469f6e
Gerrit-Change-Number: 6618
Gerrit-PatchSet: 3
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20171003/7953ee63/attachment-0001.html>


More information about the asterisk-commits mailing list