Bug 151280 - Web Inspector: Dashboard log message count doesn't include console.time messages
Summary: Web Inspector: Dashboard log message count doesn't include console.time messages
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: EasyFix, GoodFirstBug, InRadar
Depends on:
Blocks:
 
Reported: 2015-11-13 16:12 PST by Matt Baker
Modified: 2016-01-10 12:24 PST (History)
9 users (show)

See Also:


Attachments
Patch (1.66 KB, patch)
2016-01-10 03:42 PST, Johan K. Jensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2015-11-13 16:12:11 PST
* SUMMARY
Dashboard log message count doesn't include console.time messages. The Console log filter shows console.time messages when "Logs" is selected, so they should be included in the total.

* STEPS TO REPRODUCE
1. Inspector -> Console tab
2. Type "console.log(1)"
3. Dashboard log count is 1.
4. Type "console.time('foo')"
5. Type "console.timeEnd('foo')"
  => Log count is 1. Expected 2.

Filtering the Console log by "Errors" hides the time marker. Filtering by "Logs" shows the time marker.
Comment 1 Radar WebKit Bug Importer 2015-11-13 16:12:49 PST
<rdar://problem/23543063>
Comment 2 Johan K. Jensen 2016-01-09 13:00:11 PST
The problem is in `_incrementConsoleMessageType` in `Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js`, where it only increments log/issue/error-count if the ConsoleMessage has the levels log, warning, or error respectively.
As there also exists MessageLevels info and debug, those are not included in the log-count.
Adding two fallthrough cases for info and debug to also increment the log-count would solve the problem.
This would make `console.timeEnd()`, `console.debug()`, and `console.info()` increment the log-count in the dashboard.

If that sounds like an okay solution, I’d like to submit a patch.
Comment 3 Matt Baker 2016-01-09 23:01:58 PST
(In reply to comment #2)
> The problem is in `_incrementConsoleMessageType` in
> `Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js`, where it
> only increments log/issue/error-count if the ConsoleMessage has the levels
> log, warning, or error respectively.
> As there also exists MessageLevels info and debug, those are not included in
> the log-count.

The Chrome console API reference states that console.info and console.debug are identical to console.log, so it works for me!

> Adding two fallthrough cases for info and debug to also increment the
> log-count would solve the problem.
> This would make `console.timeEnd()`, `console.debug()`, and `console.info()`
> increment the log-count in the dashboard.
> 
> If that sounds like an okay solution, I’d like to submit a patch.

Sounds good.
Comment 4 Johan K. Jensen 2016-01-10 03:42:55 PST
Created attachment 268643 [details]
Patch
Comment 5 Brian Burg 2016-01-10 11:36:56 PST
Comment on attachment 268643 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2016-01-10 12:24:43 PST
Comment on attachment 268643 [details]
Patch

Clearing flags on attachment: 268643

Committed r194828: <http://trac.webkit.org/changeset/194828>
Comment 7 WebKit Commit Bot 2016-01-10 12:24:48 PST
All reviewed patches have been landed.  Closing bug.