Re: Standardizing console APIs: Where?

On 27/02/2013, at 22:46, Marcos Caceres wrote:
> On Wednesday, 27 February 2013 at 21:24, Boris Zbarsky wrote:
>> On 2/27/13 3:47 PM, François REMY wrote:
>>> However, I feel like the object-to-string behavior should be standardized
>> 
>> This assumes there is a conversion to string at all. The point of the  
>> discussion about clickable stuff is that some log() implementations show  
>> objects as trees or whatnot, not as strings.
> 
> I was going to say exactly the same thing. 

@Zbarsky: I think that those clickable interactive trees and whatnots are über awesome when in interactive mode, when one's typing at the console, but to get them programatically perhaps one should have to call .dir() [1] not .log(), don't you think so?

If .log() -as it seems- is the printf() [2], that means ~ === print to "stdout" with formatting, and then it should output plain text.

When you do a console.log(obj) in a loop as in that example, to observe obj changing, delaying the serialization obviously won't work... unless we want to have to .log(serialize it upfront)

> Different browsers display these things in wildly different (and wonderfully useful) ways. It's a competitive differentiator. 

That every browser "displays these things in wildly different (and wonderfully useful) ways" might be fine for .dir() but not so much for .log().

[1] <https://developer.mozilla.org/en-US/docs/DOM/console.dir>
[2] <https://developer.mozilla.org/en-US/docs/DOM/console.log>
-- 
Jorge.

Received on Thursday, 28 February 2013 18:32:20 UTC