When debugging I prefer using the Devel module because of the clickable Krumo output.

However when disabling the Devel module on production unremoved calls to e.g. dsm() can cause a WSOD because of calls to undefined functions.

By using the built-in debug function this does not happen but it will miss the nice krumo output.

Is it possible to get krumo output with the debug() function / or otherwise prevent the WSOD on production sites when using devel functions?

1 Answer 1


Use a custom code and define your own debug function that uses dsm if available or debug if not:

function my_debug($data, $label = NULL, $print_r = FALSE) {
  if (function_exists('dsm')) {
    dsm($data, $label);
  else {
    debug($data, $label, $print_r);

But keep in mind that you should avoid any debug code in production.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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