On 05/24/2017 03:56 PM, Nick Gearls wrote: > I added some debugging features in mod_substitute, damned useful when trying > to troubleshoot things. > I'll propose a patch but I'd like your advise about when to log debug info: > > I added the following info: > 1. line to be parsed, type or search (regex/string), replace string > 2. in case of matching, the new value > > All logging of debugging info is in level TRACE8 > > Remark: the matching string/regex is compiled, so it's not available at > run-time. > I added this info in the subst_pattern_t struct - with a #ifdef _DEBUG to not > waste memory in release mode > > My main question is: do I leave all logging in release mode (TRACE8 level) or > do I also make this logging dependent on > the compile flag?
Neither :-). Have a look at the APLOG_*_IS_LEVEL macros in http_log.h and wrap the code that creates effort accordingly. If the effort is just a simple ap_log_?error line then you need to nothing if compiled with a c99 compiler. See the ap_log_* macro magic in http_log.h Regards RĂ¼diger
