Closed Bug 1461001 Opened 2 years ago Closed 2 years ago

Implement frontend for console.timeLog

Categories

(DevTools :: Console, enhancement)

enhancement
Not set
normal

Tracking

(firefox62 fixed)

RESOLVED FIXED
Firefox 62
Tracking Status
firefox62 --- fixed

People

(Reporter: bgrins, Assigned: nchevobbe)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

The platform handling is being added in Bug 1458466. We'll need to add a stub for the API call and then render basically the same message we render for timeEnd.
Nicolas: is this something you think we'll have bandwidth to take in 62? It seems like this'll be a simple frontend change, but I want to make sure we ship the frontend part in the same release where we land the platform part.
Flags: needinfo?(nchevobbe)
It seems like a small thing to me, and I'm almost 100% positive it can be done in 62
Flags: needinfo?(nchevobbe)
Should we have different output between timeLog and timeEnd ?
I know that timeLog can have multiple arguments to clarify what call it refers to, but if none provided, it's a bit hard to follow what's going on.

The following code: 

```js
console.time("bar");
console.timeLog("bar");
console.timeLog("bar");
console.timeEnd("bar");
```

will output: 

> 14:12:46.661 bar: 1ms debugger eval code:2:1
> 14:12:46.662 bar: 2ms debugger eval code:3:1
> 14:12:46.663 bar: 3ms debugger eval code:4:1 

I feel like the timeEnd should have either a different label, or an icon or something that indicate that it _is_ the timeEnd.
Comment on attachment 8979294 [details]
Bug 1461001 - Implement frontend for console.timeLog; .

https://reviewboard.mozilla.org/r/245482/#review251472

::: devtools/client/webconsole/utils/messages.js:109
(Diff revision 1)
>        } else {
>          // We don't show anything for console.time calls to match Chrome's behaviour.
>          type = MESSAGE_TYPE.NULL_MESSAGE;
>        }
>        break;
> +    case "timeLog":

Nit: given the amount of code / comments shared between them, I'd rather collapse timeLog and timeEnd into the same `case` and have a condition inside of the else if that sets `parameters` in one case and `messageText` in the other. Up to you.
Attachment #8979294 - Flags: review?(bgrinstead) → review+
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d441f5a05fbc
Implement frontend for console.timeLog; r=bgrins.
Blocks: 1463347
https://hg.mozilla.org/mozilla-central/rev/d441f5a05fbc
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
Keywords: dev-doc-needed
Product: Firefox → DevTools
Added a new page to: https://developer.mozilla.org/en-US/docs/Web/API/Console/Console.timeLog()
Flags: needinfo?(nchevobbe)
(In reply to Irene Smith from comment #10)
> Added a new page to:
> https://developer.mozilla.org/en-US/docs/Web/API/Console/Console.timeLog()

thanks Irene, that looks good.
Do you plan to update the example you point to ([1]), since it does not have a `console.timeLog(timer)` line in it ?

[1] https://developer.mozilla.org/en-US/docs/Web/API/console#Timers
Flags: needinfo?(nchevobbe)
Thank you for the reminder. I will update that later this afternoon.
The actual page is located here: https://developer.mozilla.org/en-US/docs/Web/API/Console/timeLog

I had the wrong location to begin with and had to move it.

I have updated the example here: https://developer.mozilla.org/en-US/docs/Web/API/Console
You need to log in before you can comment on or make changes to this bug.