]> git.ipfire.org Git - thirdparty/asterisk.git/commit
logger.h: Add SCOPE_CALL and SCOPE_CALL_WITH_RESULT
authorGeorge Joseph <gjoseph@sangoma.com>
Tue, 9 Apr 2024 20:49:36 +0000 (14:49 -0600)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 18 Jul 2024 14:04:42 +0000 (14:04 +0000)
commit0203bc0df5572a4e9f1afe75f78358752ec3b344
tree5e869eb1eefc478e586efed0391fee7a3060e40c
parentc543090c81a7afa597ae90caf8e352e92aa017e0
logger.h:  Add SCOPE_CALL and SCOPE_CALL_WITH_RESULT

If you're tracing a large function that may call another function
multiple times in different circumstances, it can be difficult to
see from the trace output exactly which location that function
was called from.  There's no good way to automatically determine
the calling location.  SCOPE_CALL and SCOPE_CALL_WITH_RESULT
simply print out a trace line before and after the call.

The difference between SCOPE_CALL and SCOPE_CALL_WITH_RESULT is
that SCOPE_CALL ignores the function's return value (if any) where
SCOPE_CALL_WITH_RESULT allows you to specify the type of the
function's return value so it can be assigned to a variable.
SCOPE_CALL_WITH_INT_RESULT is just a wrapper for SCOPE_CALL_WITH_RESULT
and the "int" return type.

(cherry picked from commit 741b3c0dbb129b145bf269e15494ba08b3d7c650)
include/asterisk/logger.h