{ "id": "159701", "key": "TIMOB-23237", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [ { "id": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-04-29T14:35:19.000+0000", "created": "2016-04-19T18:02:40.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity", "qe-5.3.0" ], "versions": [ { "id": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" }, { "id": "17993", "description": "Release 5.2.2", "name": "Release 5.2.2", "archived": false, "released": true, "releaseDate": "2016-04-05" } ], "issuelinks": [ { "id": "51525", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159902", "key": "TIMOB-23295", "fields": { "summary": "Android: parity in Ti.API.log with iOS / Windows", "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": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-05-03T15:27:42.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\n*This is not a regression*\r\n\r\nWhen using Ti.API.log there are some inconsistencies with other platforms. Firstly, by default it appears that it will log at the debug level when the specified log level is not recognised rather than info, with the log message prefixed with the unrecognised string\r\n\r\nAlso it appears that any logging performed using Ti.API.log will always take on the log level of the last statement, so if I log Ti.API.error('log') and then Ti.API.log('info, 'log') the Ti.API.log statement will be printed out at the error logging level. See below for an example\r\n\r\n{code}\r\nTi.API.log('meh','I am default log');\r\n\r\nTi.API.error('logging to change other Ti.API.log statements');\r\n\r\nTi.API.log('error','I am error from log');\r\nTi.API.log('debug', 'I am debug from log');\r\nTi.API.log('info', 'I am info from log');\r\nTi.API.log('trace', 'I am trace from log');\r\nTi.API.log('warn', 'I am warn from log');\r\n{code}\r\n\r\n{code: title=Logging on Windows Platform}\r\n[DEBUG] I am default log\r\n[ERROR] logging to change other Ti.API.log statements\r\n[ERROR] I am error from log\r\n[ERROR] I am debug from log\r\n[ERROR] I am info from log\r\n[ERROR] I am trace from log\r\n[ERROR] I am warn from log\r\n{code}\r\n\r\n{code: title=Logging on Android}\r\n[INFO] [meh] I am default log\r\n[ERROR] logging to change other Ti.API.log statements\r\n[ERROR] I am error from log\r\n[INFO] I am info from log\r\n[WARN] I am warn from log\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Using the code above build to a Windows emulator using {{appc run -p windows -T wp-emulator}}\r\n(This also happens with wp-device and ws-local)\r\n\r\nh5.Actual result\r\n\r\n# All logging takes place at the DEBUG level by default \r\n# A log can change the log level for logs that follow it\r\n# An unrecognised level is not logged as [INFO] [level] \r\n\r\nh5.Expected result\r\n\r\n#The logging should take place at the level specified in the code\r\n# An unrecognised level should be logged as [INFO] [level] \r\n# A log should not be able to change the log level of logs that follow it", "attachment": [], "flagged": false, "summary": "Windows: Inconsistencies in Ti.API.log", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Windows 10 Pro\r\nVisual Studio 2015 Community Update 2\r\nAppc Core: 5.3.0-20\r\nAppc NPM: 4.2.5-2\r\nTi SDK: 5.3.0.v20160418111755", "closedSprints": [ { "id": 618, "state": "closed", "name": "2016 Sprint 08 SDK", "startDate": "2016-04-09T00:30:18.262Z", "endDate": "2016-04-23T00:30:00.000Z", "completeDate": "2016-04-25T02:38:28.511Z", "originBoardId": 114 }, { "id": 624, "state": "closed", "name": "2016 Sprint 09 SDK", "startDate": "2016-04-23T00:39:45.452Z", "endDate": "2016-05-07T00:39:00.000Z", "completeDate": "2016-05-09T03:43:10.279Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "383222", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "\r\nOn iOS {{Ti.API.log('meh', 'I am default log');}} prints nothing. I'll make Windows align with iOS.\r\n\r\n{code: title=Logging on iOS}\r\n [ERROR] logging to change other Ti.API.log statements\r\n [ERROR] I am error from log\r\n [INFO] I am info from log\r\n [WARN] I am warn from log\r\n{code}\r\n\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-20T01:58:29.000+0000", "updated": "2016-04-20T01:58:29.000+0000" }, { "id": "383229", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/637", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-20T02:24:33.000+0000", "updated": "2016-04-20T02:24:33.000+0000" }, { "id": "383258", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "updateAuthor": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-20T07:09:20.000+0000", "updated": "2016-04-20T07:09:20.000+0000" }, { "id": "384111", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "[~kota] Upon investigation, {{Ti.API.log('meh', 'I am default log');}} appears to print nothing on iOS unless you set the log-level to DEBUG or TRACE, it actually seems to print the custom log message under [DEBUG]. However, when tested on windows it does not print anything at all. Below is the following console at TRACE level on *Windows*:\r\n\r\n{code:java}\r\n[ERROR] : logging to change other Ti.API.log statements\r\n[ERROR] : I am error from log\r\n[DEBUG] : I am debug from log\r\n[INFO] : I am info from log\r\n[TRACE] : I am trace from log\r\n[WARN] : I am warn from log\r\n{code}\r\n\r\nconsole at TRACE level on *iOS*:\r\n{code:java}\r\n[DEBUG] : [MEH] I am default log\r\n[INFO] : I am info from log\r\n[ERROR] : logging to change other Ti.API.log statements\r\n[ERROR] : I am error from log\r\n[DEBUG] : I am debug from log\r\n[TRACE] : I am trace from log\r\n[WARN] : I am warn from log\r\n{code}\r\n\r\n\r\nTo maintain consistency between the platforms, I would suggest either: \r\n1. Android be changed to match the behaviour seen on Windows, and to remove the custom log messages on iOS appearing as [DEBUG]. \r\n2. Change iOS & Windows to support custom log messages, to match Android.\r\n\r\nTested on: \r\nWindows 10 Pro \r\nWindows Phone 10.0 & 8.1 (Microsoft Lumia 640 LTE) \r\nAppc Studio: 4.6.0.201604081249 \r\nTi SDK: 5.3.0.v20160421080259 \r\nAppc NPM: 4.2.5-3\r\nAppc Core: 5.3.0-36\r\nNode: v4.4.2\r\n ", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-04-27T19:52:49.000+0000", "updated": "2016-04-27T20:26:06.000+0000" }, { "id": "384273", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "[~kota] So the difference here seems to be that we ignore custom log levels, and iOS spits them out under [DEBUG] [CUSTOM_UPPERCASE]. So we should match that on Windows.\r\n\r\n[~htbryant] As for Android, well I think another ticket should be opened up for parity to fix on that platform. We considered iOS to be the \"reference\" platform in this case.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-28T23:48:21.000+0000", "updated": "2016-04-28T23:48:21.000+0000" }, { "id": "384310", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/650\r\nhttps://github.com/appcelerator/titanium_mobile_windows/pull/651\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-29T08:23:59.000+0000", "updated": "2016-04-29T08:23:59.000+0000" }, { "id": "384353", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-04-29T18:14:40.000+0000", "updated": "2016-04-29T18:14:40.000+0000" }, { "id": "384489", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed\r\n\r\nTested on: \r\nWindows 10 Pro \r\nWindows Phone 10.0 (Microsoft Lumia 640 LTE) \r\nAppc Studio: 4.6.0.201604290815\r\nTi SDK: 5.3.0.v20160430043601\r\nAppc NPM: 4.2.5-5\r\nAppc Core: 5.3.0-40\r\nNode: v4.4.2\r\n\r\n*Closing Ticket.*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-02T19:58:15.000+0000", "updated": "2016-05-02T19:58:15.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }