Merge branch 'MDL-41985-master' of git://github.com/andrewnicols/moodle
authorDan Poltawski <dan@moodle.com>
Wed, 9 Oct 2013 08:27:50 +0000 (16:27 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 9 Oct 2013 08:27:50 +0000 (16:27 +0800)
config-dist.php
lib/outputrequirementslib.php

index e57a61d..c5bf4be 100644 (file)
@@ -489,6 +489,24 @@ $CFG->admin = 'admin';
 // Prevent JS caching
 // $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!
 //
+// Restrict which YUI logging statements are shown in the browser console.
+// For details see the upstream documentation:
+//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logInclude
+//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logExclude
+// $CFG->yuiloginclude = array(
+//     'moodle-core-dock-loader' => true,
+//     'moodle-course-categoryexpander' => true,
+// );
+// $CFG->yuilogexclude = array(
+//     'moodle-core-dock' => true,
+//     'moodle-core-notification' => true,
+// );
+//
+// Set the minimum log level for YUI logging statements.
+// For details see the upstream documentation:
+//   http://yuilibrary.com/yui/docs/api/classes/config.html#property_logLevel
+// $CFG->yuiloglevel = 'debug';
+//
 // Prevent core_string_manager application caching
 // $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!
 //
index 3c62282..acf5dd9 100644 (file)
@@ -249,6 +249,17 @@ class page_requirements_manager {
             $this->YUI_config->debug = false;
         }
 
+        // Include the YUI config log filters.
+        if (!empty($CFG->yuilogexclude) && is_array($CFG->yuilogexclude)) {
+            $this->YUI_config->logExclude = $CFG->yuilogexclude;
+        }
+        if (!empty($CFG->yuiloginclude) && is_array($CFG->yuiloginclude)) {
+            $this->YUI_config->logInclude = $CFG->yuiloginclude;
+        }
+        if (!empty($CFG->yuiloglevel)) {
+            $this->YUI_config->logLevel = $CFG->yuiloglevel;
+        }
+
         // Add the moodle group's module data.
         $this->YUI_config->add_moodle_metadata();