Bug 151280

Summary: Web Inspector: Dashboard log message count doesn't include console.time messages
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, jj, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: EasyFix, GoodFirstBug, InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

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 BJ 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.