{ "id": "173057", "key": "TIMOB-26861", "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": [], "resolution": null, "resolutiondate": null, "created": "2019-02-26T11:35:08.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "engSchedule" ], "versions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [], "assignee": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-11-23T17:53:05.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": [], "description": "There are multiple issues with logging from native modules.\r\n\r\n*ObjC modules*\r\nThe module template uses {{DebugLog}} by default. This is a macro that only logs when {{DEBUG}} is defined. However, a module is always built with the \"Release\" configuration which does not has {{DEBUG}} defined. It is enabled in the \"Debug\" configuration but there is no way to select that during module build. The only way to enable it is to define {{DEBUG}} in the Release configuration which would defeat the purpose of two different configurations.\r\n\r\n{{NSLog}} works as expected in ObjC modules.\r\n\r\n*Swift modules*\r\nIn Swift modules no logging works at all. Neither {{debugPrint}}, {{print}} nor {{NSLog}} print anything to the logs. This is somewhat expected for {{debugPrint}} and {{print}} since they only work with the Xcode debugger log.\r\n\r\nFor {{NSLog}} however, the only way to get any logs is to check the Console app where log messages will appear. The default Titanium device/simulator log doesn't contain any logging made from within a Swift module with {{NSLog}}.\r\n\r\n[~cbarber] you are familiar with our logging, any idea why no logs appear from Swift modules?", "attachment": [], "flagged": false, "summary": "Logging inside native modules not working properly", "creator": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "446330", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "If you prefix the log with {{[DEBUG]}}, {{[TRACE]}}, {{[INFO]}}, {{[WARN]}} or {{[ERROR]}} it will be displayed. The logger system expects those. Would be cool to pump Swift's {{debugLog}} to {{DEBUG}} directly.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-26T21:10:22.000+0000", "updated": "2019-02-26T21:10:22.000+0000" }, { "id": "446332", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "Nope, even that won't make logs appear in Swift modules. I tested all day with another module issue and the only way i could see logs from within Swift modules was to check through the Console app.\r\n\r\nI guess it has something to do with our redefinition of {{NSLog}} which won't be picked up by Swift.\r\n\r\nAlso, there is another side effect which i suspect to be related to redefining NSLog: All output from NSLog made in third-party frameworks is completely gone. I noticed this when working with Localytics in Hyperloop. You can enable [logging|https://docs.localytics.com/dev/ios.html#troubleshooting-ios] in Localytics but won't see any logging at all, neither to the Console app nor in our Titanium log server.\r\n\r\nI'll add some reproducible code snippets when i have time.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-26T21:33:15.000+0000", "updated": "2019-02-26T21:33:15.000+0000" }, { "id": "448473", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Good to know and good to be resolved! It definitely works for ObjC modules as you described, so the ticket name may include \"Swift\" as well.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-05-17T12:56:57.000+0000", "updated": "2019-05-17T12:56:57.000+0000" }, { "id": "455404", "author": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Any news on this? or any kind of workaround?", "updateAuthor": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-08T12:32:28.000+0000", "updated": "2020-05-08T12:32:28.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }