Full ELMS Learning Network documentation
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.
Parameters
$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
dd()
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/ admin.inc - Form builder for the advanced admin settings page.
File
- sites/
all/ modules/ ulmus/ devel/ devel.module, line 1619
Code
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;
}
}