Problem
Currently, "Ti.API.debug" prints object in a way it calls object's "toString" function. That way we get string "[object Object]" for native objects. But that information is useless for debugging purposes. It would be much better if objects were printed as JSON.
Test case
var myObject = { prop: 42 };
Ti.API.debug(myObject);
Output
Console output is "[object Object]", while it should be printing: "{ prop: 42 }", or even better (to avoid ambiguity): myObject: "{ prop: 42 }".
Workaround
A workaround is to use "JSON.stringify" prior to calling "Ti.API.debug": Ti.API.debug(JSON.stringify(myObject));
On iOS and Mobile Web, the object's properties are logged, so this is a parity issue. Logging is slightly different by platform. Mobile Web logs: { "prop": 42 } While iPhone logs: { prop = 42; } But both are eminently usable.
Usable yes, but JSON no. :) IMHO, JSON format should be preferred for JS object representation.
Confirmed. This is still an issue as of Titanium SDK 6.1.0 master branch.