function drupal_debug

cis7 devel.module drupal_debug($data, $label = NULL)
cle7 devel.module drupal_debug($data, $label = NULL)
elmsmedia7 devel.module drupal_debug($data, $label = NULL)
icor7 devel.module drupal_debug($data, $label = NULL)
meedjum_blog7 devel.module drupal_debug($data, $label = NULL)
mooc7 devel.module drupal_debug($data, $label = NULL)

Logs a variable to a drupal_debug.txt in the site's temp directory.


$data: The variable to log to the drupal_debug.txt log file.

$label: (optional) If set, a label to output before $data in the log file.

Return value

No return value if successful, FALSE if the log file could not be written to.

See also


1 call to drupal_debug()
dd in sites/all/modules/ulmus/devel/devel.module
2 string references to 'drupal_debug'
views_debug in sites/all/modules/ulmus/views/views.module
Provide debug output for Views.
views_ui_admin_settings_advanced in sites/all/modules/ulmus/views/includes/
Form builder for the advanced admin settings page.


sites/all/modules/ulmus/devel/devel.module, line 1619


function drupal_debug($data, $label = NULL) {
  $out = ($label ? $label . ': ' : '') . print_r($data, TRUE) . "\n";

  // The temp directory does vary across multiple simpletest instances.
  $file = 'temporary://drupal_debug.txt';
  if (file_put_contents($file, $out, FILE_APPEND) === FALSE) {
    drupal_set_message(t('The file could not be written.'), 'error');
    return FALSE;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.