Moodle
  1. Moodle
  2. MDL-28957

Excessive logging overloads firebug logs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: 2.1.2
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      already in bug. basically use firebug console on pretty much any moodle page. Before fix you'll see a constant stream of logs. After they'll stop after page load. Add a yui or console log some where in the js and see if you can find it in the console after the page has loaded. After the fix you should be able to. Before it just got pushed out of view by the new logs.

      Show
      already in bug. basically use firebug console on pretty much any moodle page. Before fix you'll see a constant stream of logs. After they'll stop after page load. Add a yui or console log some where in the js and see if you can find it in the console after the page has loaded. After the fix you should be able to. Before it just got pushed out of view by the new logs.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull Master Branch:
    • Rank:
      18630

      Description

      The yui log call in yui/3.2.0/build/dom/dom-debug.js query() method

      Y.log('query: ' + selector + ' returning: ' + ret.length, 'info', 'Selector');
      

      Is called every time a dom query is made.This is a continual process while a moodle page is available and continually fills the firebug and chrome console logs.

      It's also a small memory leak if you leave a moodle page open for long enough or have many open.
      Any debugging using these consoles becomes impossible. Please comment out the line.

      Replication instructions:

      1. Open firebug on a course homepage.
      2. View the console with the 'all' log entries option selected. normally the console fills up and then states 'firebugs log limit has been reached xxxx entries not shown' This doesn't require you to do anything on the page.

      when fixed you'll see a lot of console entries on page load but then they'll stop. No more will appear until you do something on the page.

        Activity

        Hide
        Colin Chambers added a comment -

        tim hunt pointed out that yui3.2.0 is a direct copy of the release version of yui. I checked yui 3 on git hub and found he's correct.

        So adjusting dom-debug.js is not the answer. Tim then suggested checking out lib/outputrequirementslib.php line 128
        $this->yui3loader->filter = YUI_DEBUG; // alternatively we could use just YUI_RAW here
        $this->yui2loader->filter = YUI_DEBUG; // alternatively we could use just YUI_RAW here

        replace YUI_DEBUG with YUI_RAW. the problem goes away. All onload debugging is stopped. That fixes things for me. not sure what's lost though. A couple of yui files like event and event-key seem to use minified files. the others all seem to use the unminified source. Hence still easy to debug

        Show
        Colin Chambers added a comment - tim hunt pointed out that yui3.2.0 is a direct copy of the release version of yui. I checked yui 3 on git hub and found he's correct. So adjusting dom-debug.js is not the answer. Tim then suggested checking out lib/outputrequirementslib.php line 128 $this->yui3loader->filter = YUI_DEBUG; // alternatively we could use just YUI_RAW here $this->yui2loader->filter = YUI_DEBUG; // alternatively we could use just YUI_RAW here replace YUI_DEBUG with YUI_RAW. the problem goes away. All onload debugging is stopped. That fixes things for me. not sure what's lost though. A couple of yui files like event and event-key seem to use minified files. the others all seem to use the unminified source. Hence still easy to debug
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this.

        Show
        Michael de Raadt added a comment - Thanks for reporting this.
        Hide
        Colin Chambers added a comment -

        Updated related code comment on tims suggestion.

        Show
        Colin Chambers added a comment - Updated related code comment on tims suggestion.
        Hide
        Tim Hunt added a comment -

        +1 from me. I have never found any use for the excessive debug output, and I find it does stop me seeing useful things in the console.

        Show
        Tim Hunt added a comment - +1 from me. I have never found any use for the excessive debug output, and I find it does stop me seeing useful things in the console.
        Hide
        Tim Hunt added a comment -

        Submitting for integration.

        Show
        Tim Hunt added a comment - Submitting for integration.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated, thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
        Hide
        Michael de Raadt added a comment -

        Test result: information and warnings were shown when the page loaded, but no additional log messages were added as the page sat there for several minutes. Test passed.

        Show
        Michael de Raadt added a comment - Test result: information and warnings were shown when the page loaded, but no additional log messages were added as the page sat there for several minutes. Test passed.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Many thanks for the hard work, this has been sent upstream and is available in all the git and cvs repositories.

        Show
        Eloy Lafuente (stronk7) added a comment - Many thanks for the hard work, this has been sent upstream and is available in all the git and cvs repositories.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: