diff options
author | George Joseph <gjoseph@digium.com> | 2017-09-27 12:45:21 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-09-28 12:18:41 -0500 |
commit | 00fc98d3302ae6ed42bdb599512ef00f5c148465 (patch) | |
tree | d50d8fb2a1b78b11e482fbcfd25c50f163911406 | |
parent | 821927b077e5b71c10c56c25b58138dc3e5e6854 (diff) |
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
-rw-r--r-- | include/asterisk/logger.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index 849f986b3..8b1e5fe01 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -429,7 +429,9 @@ void ast_callid_strnprint(char *buffer, size_t buffer_size, ast_callid callid); #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 |