Permalink
Browse files

Updating Debugger::log to get the source from the end of the stack

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8127 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
1 parent 14aaa16 commit 0a610d2c305689fd98529ca6937091fe17373fda @davidpersson davidpersson committed Mar 23, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 cake/libs/debugger.php
View
3 cake/libs/debugger.php
@@ -144,7 +144,8 @@ function log($var, $level = LOG_DEBUG) {
if (is_object($trace[0]['object']) && isset($trace[0]['object']->_reporter->_test_stack)) {
$stack = $trace[0]['object']->_reporter->_test_stack;
- $source = "[". $stack[0].", ". $stack[2] ."::" . $stack[3] ."()]\n";
+ $source = sprintf('[%1$s, %3$s::%2$s()]' . "\n",
+ array_shift($stack), array_pop($stack), array_pop($stack));
}
CakeLog::write($level, $source . $_this->exportVar($var));

0 comments on commit 0a610d2

Please sign in to comment.