dsm requires the devel module but I guess you have that installed anyway if your developing modules. debug and watchdog having the advantage that is writes to the log file.

I can see the advantage of watchdog on a live site so users don't get bugged by messages while debugging the site. but is harder to use ( you have to write more code )

dsm and dpm are short and simple to use but don't always show output.

So are I think debug is the best way to go while developing modules (on your test server). But apparently it doesn't handle array's that well.

Which one do you use and why do you think that is the best / better or should I use the different functions for different purposes?


If devel is available, i use mostly dpm. If not, I use drupal_set_message(print_r($array, true)). This helps me in the most cases. If both are not available or visible, I use the Watchdog.


watchdog has always been a preference for me. Most of the situations my troubles involve checking values before submit or redirects and using dpm and dsm to check debugging info in the message tab seem a bit out of place. Checking the logs in the admin end and having the ability to filter seems a better thought for debugging.... but that's just me.


I realize this is extremely late, but another option is the devel_debug_log module. It still requires the devel module, but it allows you to log your devel related messages.

Not the answer you're looking for? Browse other questions tagged or ask your own question.