Re: Standardizing console APIs: Where?

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