Closed Bug 986737 Opened 10 years ago Closed 5 years ago

Consider raising the limit of messages in the webconsole output before pruning

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1390176

People

(Reporter: evanw, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36

Steps to reproduce:

1. Put this in an html file:

<script>
  console.log('important information');
  for (var i = 0; i < 500; i++) console.log('unimportant information', i);
</script>

2. Open the html file in Firefox and look at the console


Actual results:

Only 200 log messages are shown, "unimportant information 300" through "unimportant information 499". Old log messages are continually deleted to make room for new log messages.



Expected results:

No log messages should be deleted (this is how the console works in Chrome). I understand this is probably for performance but it is actually makes debugging very difficult because the first log messages, which are the first ones to be deleted, are likely where the problem is in the first place.

It would be ok if deleting log messages stays the default behavior as long as there is some sticky option that can be enabled to not delete any log messages. I tried looking for a setting but "Enable persistent logs" only made the problem worse. With persistent logs enabled, continual log messages cause the log to constantly auto-scroll back to the previous page's logs, which makes it impossible to see any of the current page's logs.
Component: Untriaged → Developer Tools: Console
Thanks for the bug report!

You can change the number of messages allowed in the webconsole output. Go to about:config and add the following pref:

  devtools.hud.loglimit.console

Set it to the maximum number of messages you want allowed.

There is a preference for each category:

- cssparser for CSS-related messages,
- exception for JS-related messages,
- console for window.console API messages,
- network,
- security,
- input,
- output.

Each category name in the above list is associated to a preference with the "devtools.hud.loglimit." prefix.
That's great! I set mine to INT_MAX (2147483647) and debugging with logging is sane again. Is there a way to change the default behavior? I feel like it would make debugging a lot easier for everyone if the console either behaved like Chrome and never deleted log messages or if there was some discoverable way to either raise the limit or toggle showing all messages? Maybe something like "500 messages hidden, click to view all"?

All other references to this preference I could find seem to indicate that this was done for convenience and not for performance:

* https://bugzilla.mozilla.org/show_bug.cgi?id=626422
* https://bugzilla.mozilla.org/show_bug.cgi?id=644419
* https://bugzilla.mozilla.org/show_bug.cgi?id=647460
* https://groups.google.com/forum/#!topic/mozilla.dev.apps.firefox/kHVqp5EDbEg

It may be convenient, especially for network requests, but it makes debugging near impossible if you don't know about the hidden about:config value.
We will consider raising the limit. We should make it one pref for all categories as well.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
Summary: Developer console log deletes log messages → Consider raising the limit of messages in the webconsole output before pruning
Version: 30 Branch → Trunk
Product: Firefox → DevTools
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.