extra debuggin

This commit is contained in:
Rudi Grinberg 2012-09-06 12:17:18 -04:00
parent 9079f29584
commit 56527e727c
2 changed files with 20 additions and 7 deletions

View File

@ -813,8 +813,8 @@ class ScheduleController extends Zend_Controller_Action
$data[$j["name"]] = $j["value"];
}
$data['add_show_hosts'] = $this->_getParam('hosts');
$data['add_show_day_check'] = $this->_getParam('days');
$data['add_show_hosts'] = $this->_getParam('hosts');
$data['add_show_day_check'] = $this->_getParam('days');
if ($data['add_show_day_check'] == "") {
$data['add_show_day_check'] = null;
@ -828,10 +828,14 @@ class ScheduleController extends Zend_Controller_Action
$this->view->addNewShow = true;
$this->view->newForm = $this->view->render(
'schedule/add-show-form.phtml');
Logging::debug("Show creation succeeded");
Logging::sparse_debug( $data );
} else {
$this->view->addNewShow = true;
$this->view->form = $this->view->render('
schedule/add-show-form.phtml');
Logging::debug("Show creation failed");
Logging::sparse_debug( $data );
}
}

View File

@ -69,6 +69,10 @@ class Logging {
public static function debug($p_msg)
{
if (!(defined('APPLICATION_ENV') && APPLICATION_ENV == "development")) {
return;
}
$bt = debug_backtrace();
$caller = array_shift($bt);
@ -78,11 +82,16 @@ class Logging {
$caller = array_shift($bt);
$function = $caller['function'];
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development") {
$logger = self::getLogger();
$logger->debug("[$file : $function() : line $line] - ".self::toString($p_msg));
}
$logger = self::getLogger();
$logger->debug("[$file : $function() : line $line] - ".self::toString($p_msg));
}
// kind of like debug but for printing arrays more compactly (skipping
// empty elements
public static function debug_sparse(array $p_msg)
{
Logging::debug("Sparse output:");
Logging::debug( array_filter($p_msg) );
}
public static function enablePropelLogging()