{ "id": "118323", "key": "ALOY-780", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15404", "description": "Alloy 2.0.0", "name": "Alloy 2.0.0", "archived": false, "released": false } ], "resolution": null, "resolutiondate": null, "created": "2013-08-12T17:19:05.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:25:44.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" } ], "description": "Add {{DEBUG}} as a compiler conditional, like {{OS_ANDROID}} or {{ENV_TEST}}. This should be false by default and configurable through the config.json. This should be used for logging or other operations that you want to be able to see regardless of deploy type, but only when debugging.\r\n\r\nh3. config.json\r\n{code:javascript}\r\n{\r\n \"DEBUG\": true\r\n}\r\n{code}\r\n\r\nh3. index.js\r\n{code:javascript}\r\n// assuming we have a \"collection\" with lots of models...\r\n\r\nfor (var i = 0; i < collection.length; i+) {\r\n var model = collection.at(i);\r\n\r\n // perform critical operation\r\n\r\n // If DEBUG=true, leave this in the code. If it is false, remove this at compile time.\r\n // Good for things like logging or other expensive, non-essential debugging operations.\r\n if (DEBUG) {\r\n Ti.API.info(JSON.stringify(model.attributes, null, ' '));\r\n }\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Support DEBUG compiler constant", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }