MDL-25150 new debugusers setting
This commit is contained in:
@@ -359,6 +359,11 @@ $CFG->admin = 'admin';
|
||||
// $CFG->debug = 38911; // DEBUG_DEVELOPER // NOT FOR PRODUCTION SERVERS!
|
||||
// $CFG->debugdisplay = true; // NOT FOR PRODUCTION SERVERS!
|
||||
//
|
||||
// You can specify a comma separated list of user ids that that always see
|
||||
// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay
|
||||
// for these users only.
|
||||
// $CFG->debugusers = '2';
|
||||
//
|
||||
// Prevent theme caching
|
||||
// $CFG->themerev = -1; // NOT FOR PRODUCTION SERVERS!
|
||||
//
|
||||
|
||||
+9
-3
@@ -2843,9 +2843,15 @@ function get_docs_url($path) {
|
||||
* @return bool
|
||||
*/
|
||||
function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
|
||||
global $CFG, $UNITTEST;
|
||||
global $CFG, $USER, $UNITTEST;
|
||||
|
||||
if (empty($CFG->debug) || $CFG->debug < $level) {
|
||||
$forcedebug = false;
|
||||
if (!empty($CFG->debugusers)) {
|
||||
$debugusers = explode(',', $CFG->debugusers);
|
||||
$forcedebug = in_array($USER->id, $debugusers);
|
||||
}
|
||||
|
||||
if (!$forcedebug and (empty($CFG->debug) || $CFG->debug < $level)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2871,7 +2877,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
|
||||
// we send the info to error log instead
|
||||
error_log('Debugging: ' . $message . $from);
|
||||
|
||||
} else if ($CFG->debugdisplay) {
|
||||
} else if ($forcedebug or $CFG->debugdisplay) {
|
||||
if (!defined('DEBUGGING_PRINTED')) {
|
||||
define('DEBUGGING_PRINTED', 1); // indicates we have printed something
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user