Skip to content

Commit 0a610d2

Browse files
committed
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
1 parent 14aaa16 commit 0a610d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cake/libs/debugger.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ function log($var, $level = LOG_DEBUG) {
144144

145145
if (is_object($trace[0]['object']) && isset($trace[0]['object']->_reporter->_test_stack)) {
146146
$stack = $trace[0]['object']->_reporter->_test_stack;
147-
$source = "[". $stack[0].", ". $stack[2] ."::" . $stack[3] ."()]\n";
147+
$source = sprintf('[%1$s, %3$s::%2$s()]' . "\n",
148+
array_shift($stack), array_pop($stack), array_pop($stack));
148149
}
149150

150151
CakeLog::write($level, $source . $_this->exportVar($var));

0 commit comments

Comments
 (0)