From: George Joseph Date: Wed, 27 Sep 2017 18:45:21 +0000 (-0600) Subject: logger: Bring back ability to turn debug on by source file X-Git-Tag: 13.18.0-rc1~30^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47620ea8626fa45929b212c18b8f20954ee1376c;p=thirdparty%2Fasterisk.git 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 --- diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index 1a2bf9098c..e19ba942ff 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -447,7 +447,9 @@ void ast_callid_strnprint(char *buffer, size_t buffer_size, struct ast_callid *c #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