I have written debug()
in a php file in my local Drupal project. I am trying to see the output. How do I do that?
1 Answer
The output should be logged to the Drupal watchdog (admin/reports/dblog). If you're debugging a variable that is an array or object, don't forget to pass TRUE as the third parameter (ref).
Although the code in question may be in a function cached by Drupal, so sometimes you need to flush the cache to trigger that code to be re-run.
Personally, I prefer using the dpm()
function from the devel module for debugging. If using an account with admin permissions, it displays arrays/objects in a way that is easier to inspect.
debug()
function?