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

Re: Standardizing console APIs: Where?

From: Michael[tm] Smith <mike@w3.org>
Date: Thu, 28 Feb 2013 23:34:41 +0900
To: Robin Berjon <robin@w3.org>
Cc: Fran├žois REMY <francois.remy.dev@outlook.com>, Garrett Smith <dhtmlkitchen@gmail.com>, Brian Kardell <bkardell@gmail.com>, Thaddee Tyl <thaddee.tyl@gmail.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>, es-discuss <es-discuss@mozilla.org>
Message-ID: <20130228143439.GE70785@sideshowbarker>
Robin Berjon <robin@w3.org>, 2013-02-28 10:10 +0100:

> On 27/02/2013 21:47 , Fran├žois REMY wrote:
> >>The script engine does not relate to clicking on things -- that
> >>happens in a browser. So do you feel that script engines must ship
> >>with a console? Or does that apply to web browsers? And if so,
> >>why?
> >
> >As Brian said, the UI itself should not be defined in the spec.
> >However, I feel like the object-to-string behavior should be
> >standardized so that any JS engine could be used reliably in a
> >command-line environment (ie console.log outputs the same string in
> >the console in all browsers/engines).
> 
> I don't think that makes sense. The Console API should just be an API for
> sending data to a console of some form.

I think there's a case where a spec could (and probably should) define
normative requirements for processing of the data that's sent to the
console, without necessarily defining exactly how it must be displayed.

The case that I think might benefit from having some processing behavior
specified follows from the fact that the first argument of some console
methods either might be a printf-like format string or it might be some
other object (maybe a normal string or maybe something else).

So I'd think you'd at least want to have something defined that specifies
1) how to detect whether the first argument is a printf-like format string
or not, and 2) if the first argument is a format string, how do you then
process the rest of the arguments.

> Whatever happens there is entirely up to the implementation.

I think that's true for the case where you're just sending objects or plain
strings to the console, but not when you're doing to format-string
thing. In order to get something unsurprising and interoperably useful for
that case, I would think some standard processing behavior for it would be
need to be explicitly specified.

> And we definitely shouldn't assume that it's limited to text.

Yeah, for sure

  --Mike

-- 
Michael[tm] Smith http://people.w3.org/mike
Received on Thursday, 28 February 2013 14:34:59 UTC

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