debugging - debug.log in CakePHP without stacktrace -
i log values of variables debug.log using:
$var = 'hello world'; debugger::log($var);
in /app/tmp/logs/debug.log
there whole stacktrace log:
2014-03-24 20:47:42 debug: usercontroller::create() - app\controller\usercontroller.php, line 21 reflectionmethod::invokeargs() - [internal], line ?? controller::invokeaction() - core\cake\controller\controller.php, line 490 dispatcher::_invoke() - core\cake\routing\dispatcher.php, line 185 dispatcher::dispatch() - core\cake\routing\dispatcher.php, line 160 [main] - app\webroot\index.php, line 108 'hello world'
i don´t need stacktrace, value of variable.
one of solutions use cakelog::write function
cakelog::write(log_debug, "your message");
you output debug.log file:
2014-07-21 16:08:25 debug: message
it impossible remove stack trace debugger::log($var). why? here cakephp code debugger.php:
public static function log($var, $level = log_debug, $depth = 3) { $source = self::trace(array('start' => 1)) . "\n"; cakelog::write($level, "\n" . $source . self::exportvar($var, $depth)); }
or edit cakephp source :)
Comments
Post a Comment