{ "id": "81735", "key": "AC-3303", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2012-01-05T09:39:38.000+0000", "created": "2011-10-19T11:07:04.000+0000", "labels": [ "tc-more-info" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:57:43.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14551", "name": "Studio", "description": "Please enter tickets related to Titanium Studio here." } ], "description": "h2. Feature Request\r\n\r\nAdd support for multiple arguments to logging methods.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nTi.API.log({sdf:\"df\"}, [1,3,5,6], \"sdfsdf\");\r\n{code}\r\n\r\nh2. Logs\r\n\r\nWith the above code, you would see the following result:\r\n\r\n{code:lang=none}\r\nObject [1,3,5,6] \"sdfsdf\"\r\n{code}\r\n\r\nAlso see attached image\r\n", "attachment": [ { "id": "23762", "filename": "Screen Shot 2011-10-19 at 21.03.43.png", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2011-10-19T11:07:04.000+0000", "size": 11223, "mimeType": "image/png" } ], "flagged": false, "summary": "Ti API: log support for multiple arguments", "creator": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "subtasks": [], "reporter": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "environment": "* Titanium SDK 1.7.3\r\n* iOS 5\r\n* iOS simulator and iPad\r\n* Mac OS X 10.7.2\r\n* Titanium Studio 1.0.4.201108101535", "comment": { "comments": [ { "id": "169920", "author": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you for raising this ticket. I am afraid we need all the information listed in the [Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist] in order to accept a ticket.\r\n\r\nOnce this ticket is complete, we can move it to the main project.\r\n\r\nThank you", "updateAuthor": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-20T13:47:51.000+0000", "updated": "2011-10-20T13:47:51.000+0000" }, { "id": "170011", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "body": "Fixed.", "updateAuthor": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2011-10-21T02:09:25.000+0000", "updated": "2011-10-21T02:09:25.000+0000" }, { "id": "177753", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "body": "Can someone reopen this?", "updateAuthor": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2012-01-02T05:39:04.000+0000", "updated": "2012-01-02T05:39:04.000+0000" }, { "id": "177776", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Sindre\r\n\r\nPlease ensure your requests are consistent. For instance, the example code produces the results you've included.\r\n\r\nI will escalate this now. Thanks for raising it.\r\n\r\nThank you", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-02T08:41:15.000+0000", "updated": "2012-01-02T08:41:15.000+0000" }, { "id": "177777", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "On second thoughts, I agree with the reasons that I presume Matt marked this as invalid, although he should have provided his reasons.\r\n\r\nArguments can be concatenated in Javascript. For example:\r\n\r\n{code:lang=javascript}\r\nTi.API.log({sdf:\"df\"} + ' ' + [1,3,5,6] + ' ' + \"sdfsdf\");\r\n{code}\r\n\r\nWhy isn't this sufficient?", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-02T08:46:31.000+0000", "updated": "2012-01-02T08:46:31.000+0000" }, { "id": "178136", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Thanks for your input here.\r\n\r\nHaving verified with one of our engineering project leads, the above solution is the recommended approach. I'm closing this ticket now.\r\n\r\n", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-05T09:39:28.000+0000", "updated": "2012-01-05T09:39:28.000+0000" }, { "id": "178169", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Sindre\r\n\r\nI realise that you are capable of writing this, but a colleague of mine kindly wrote it for you. It's not been tested, but I am sure it's almost there.\r\n\r\nCheers\r\n\r\n{code:lang=javascript|title=logger.js}\r\nexports.log = function() {\r\n var log = '';\r\n for(var i = 0, len = arguments.length; i < len; i++){\r\n switch(typeof(arguments[i])) {\r\n case 'object':\r\n case 'array':\r\n log += ' '+JSON.stringify(arguments[i]);\r\n break;\r\n case 'string':\r\n case 'number':\r\n log += ' '+arguments[i];\r\n break;\r\n case 'boolean':\r\n log += ' '+ (arguments[i]) ? 'true' : 'false';\r\n break;\r\n case 'undefined':\r\n log += ' undefined';\r\n break;\r\n default:\r\n log += ' null';\r\n }\r\n }\r\n Ti.API.info(log);\r\n};\r\n{code}\r\n\r\n{code:lang=javascript|title=app.js (Usage)}\r\nvar console = require('/logger');\r\nconsole.log({sdf:\"df\"}, [1,3,5,6], \"sdfsdf\");\r\n{code}", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-05T11:47:46.000+0000", "updated": "2012-01-05T11:47:46.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }