The "current" wiki says to use CRM_Core_Error::debug
and says, "Most runtime errors are logged here, as well as data that you explicitly write to log using the CRM_Core_Error::debug log=true parameter." However, if you set $log = true
, that just does an echo.
An older version of the docs says to use debug_var
- and this works correctly, but seems duplicative, and isn't mentioned in the current docs.
Should the documentation be changed? Or should the code be refactored?
CRM_Core_Error::debug_log_message(print_r($thing_to_debug, true));
since I do remember having problems with debug_var() a long time ago. The wiki seems to be an oversight or something lost in rewrites, since as you note the code is still there. But for bigger stuff if it's a local development copy I really do recommend the netbeans + xdebug setup the current wiki describes at the bottom, and it or other debuggers have a variables pane where you can examine the variable in realtime.