$modx->setDebug(E_ALL & ~E_NOTICE); $modx->setLogLevel(modX::LOG_LEVEL_DEBUG);
$modx->log(modX::LOG_LEVEL_DEBUG, $output);
How does one go about displaying what is available, for example displaying the SESSION array, or what values are being made available by the event?
if (!function_exists("my_debug") && $scriptProperties['debug']) {
function my_debug($message, $clear = false)
{
global $modx;
$chunk = $modx->getObject('modChunk', array('name' => 'Debug'));
if (!$chunk) {
$chunk = $modx->newObject('modChunk', array('name' => 'Debug'));
$chunk->setContent('');
$chunk->save();
$chunk = $modx->getObject('modChunk', array('name' => 'Debug'));
} else {
if ($clear) {
$content = '';
} else {
$content = $chunk->getContent();
}
}
$content .= $message . "\n";
$chunk->setContent($content);
$chunk->save();
}
}