=== modified file 'includes/common.inc'
--- includes/common.inc	2010-10-28 02:00:27 +0000
+++ includes/common.inc	2010-11-05 07:11:25 +0000
@@ -6870,6 +6870,9 @@ function _drupal_flush_css_js() {
  *   as var_export() will generate an error.
  */
 function debug($data, $label = NULL, $print_r = FALSE) {
+  if (($debug_function = variable_get('debug_function')) && function_exists($debug_function)) {
+    return $debug_function($data, $label, $print_r);
+  }
   // Print $data contents to string.
   $string = check_plain($print_r ? print_r($data, TRUE) : var_export($data, TRUE));
 

