{ "id": "85301", "key": "TIMOB-7731", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2012-01-23T08:36:29.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "parity" ], "versions": [], "issuelinks": [ { "id": "58071", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "172897", "key": "TIMOB-26756", "fields": { "summary": "Android: Object details should be printed instead of \"[object Object]\" (parity)", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2020-01-08T18:31:04.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem\r\n\r\nCurrently, \"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.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar myObject = { prop: 42 };\r\n\r\nTi.API.debug(myObject);\r\n{code}\r\n\r\nh2. Output\r\n\r\nConsole output is \"[object Object]\", while it should be printing: \"{ prop: 42 }\", or even better (to avoid ambiguity): myObject: \"{ prop: 42 }\".\r\n\r\nh2. Workaround\r\n\r\nA workaround is to use \"JSON.stringify\" prior to calling \"Ti.API.debug\": Ti.API.debug(JSON.stringify(myObject));\r\n\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Objects passed to \"Ti.API.debug\" should be printed as JSON", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 1.9.0 (01/21/12 22:31 88820ff)\r\n* Runtime: v8\r\n* Windows XP\r\n* Android 3.1\r\n* Thinkpad Tablet", "comment": { "comments": [ { "id": "191684", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "On iOS and Mobile Web, the object's properties are logged, so this is a parity issue.\r\n\r\nLogging is slightly different by platform. Mobile Web logs:\r\n\r\n{ \"prop\": 42 }\r\n\r\nWhile iPhone logs:\r\n\r\n{\r\n prop = 42;\r\n}\r\n\r\nBut both are eminently usable.\r\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-18T14:49:32.000+0000", "updated": "2012-04-18T14:49:32.000+0000" }, { "id": "191748", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Usable yes, but JSON no. :)\r\n\r\n\r\nIMHO, JSON format should be preferred for JS object representation.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-04-19T00:11:59.000+0000", "updated": "2012-04-19T00:11:59.000+0000" }, { "id": "192987", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-04-27T12:31:49.000+0000", "updated": "2012-04-28T00:13:42.000+0000" }, { "id": "394025", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Confirmed. This is still an issue as of Titanium SDK 6.1.0 master branch.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-24T02:22:54.000+0000", "updated": "2016-08-24T02:22:54.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }