From 169ccfa4429aba40bbf6a7a50bfd040f7a2613c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Mon, 14 Apr 2014 13:16:41 +0800 Subject: [PATCH] MDL-45049 improve debugging output in error log for NO_DEBUG_DISPLAY scripts --- lib/weblib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 431f846fb49..6bb45d0f484 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2840,7 +2840,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) { if (!$backtrace) { $backtrace = debug_backtrace(); } - $from = format_backtrace($backtrace, CLI_SCRIPT); + $from = format_backtrace($backtrace, CLI_SCRIPT || NO_DEBUG_DISPLAY); if (PHPUNIT_TEST) { if (phpunit_util::debugging_triggered($message, $level, $from)) { // We are inside test, the debug message was logged. @@ -2851,7 +2851,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) { if (NO_DEBUG_DISPLAY) { // Script does not want any errors or debugging in output, // we send the info to error log instead. - error_log('Debugging: ' . $message . $from); + error_log('Debugging: ' . $message . ' in '. PHP_EOL . $from); } else if ($forcedebug or $CFG->debugdisplay) { if (!defined('DEBUGGING_PRINTED')) {