W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2013

Re: Standardizing console APIs: Where?

From: Thaddee Tyl <thaddee.tyl@gmail.com>
Date: Wed, 27 Feb 2013 19:19:30 +0100
Message-ID: <CAE3TfZN3zHQKO-zhFSrKccROSyDjWVMTGBFzo2MmrWyt7nf_cw@mail.gmail.com>
To: Brian Kardell <bkardell@gmail.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Cc: es-discuss <es-discuss@mozilla.org>
On Wed, Feb 27, 2013 at 5:07 PM, Brian Kardell <bkardell@gmail.com> wrote:
> On 26/02/2013 23:06 , Brian Kardell wrote:
>>
>> 1. Does anyone else feel like we _should_ have a standard
>
>
> I think that this thread has shown that there are interoperability issues.
> Given that this is a debugging tool, you really want it to have predictable
> behaviour so as not to waste time looking for a problem that in fact comes
> from the console API.

If I'm not mistaken, the only interoperability issue that was raised
is that the display of logging data at high frequency (using `console.log`)
has a delay which may cause it to show a newer representation of the memory slot
than was passed to `console.log`.

If there was a standard, I do not believe that it should forbid this buffering.
Doing otherwise may greatly impact performance.
Remember, this issue only happens on high frequency logging;
having the logging block for immediate string conversion
will make something that happens *very often* take a lot more time!

How much time?
In browsers, when logging an object, you can actually click on an arrow
to browse through all its properties.
Serializing the whole thing on every single console.log, when those
happen in a loop,
would make the debugging experience a nightmare, performance-wise.

That being said, the standard shouldn't forbid blocking behavior either.
If it can afford to be precise, let it be!

Right now, displaying data through `console.log` is "best effort".
In order to get better information, you should set a conditional breakpoint.
Received on Wednesday, 27 February 2013 18:19:58 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:09 UTC