{"action":"created","issue":{"url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/449","labels_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/449/labels{/name}","comments_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/449/comments","events_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/449/events","html_url":"https://github.com/ResearchKit/ResearchKit/pull/449","id":105897842,"number":449,"title":"Revamp logging system","user":{"login":"rsanchezsaez","id":444313,"avatar_url":"https://avatars.githubusercontent.com/u/444313?v=3","gravatar_id":"","url":"https://api.github.com/users/rsanchezsaez","html_url":"https://github.com/rsanchezsaez","followers_url":"https://api.github.com/users/rsanchezsaez/followers","following_url":"https://api.github.com/users/rsanchezsaez/following{/other_user}","gists_url":"https://api.github.com/users/rsanchezsaez/gists{/gist_id}","starred_url":"https://api.github.com/users/rsanchezsaez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsanchezsaez/subscriptions","organizations_url":"https://api.github.com/users/rsanchezsaez/orgs","repos_url":"https://api.github.com/users/rsanchezsaez/repos","events_url":"https://api.github.com/users/rsanchezsaez/events{/privacy}","received_events_url":"https://api.github.com/users/rsanchezsaez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-10T21:07:31Z","updated_at":"2015-09-10T21:39:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ResearchKit/ResearchKit/pulls/449","html_url":"https://github.com/ResearchKit/ResearchKit/pull/449","diff_url":"https://github.com/ResearchKit/ResearchKit/pull/449.diff","patch_url":"https://github.com/ResearchKit/ResearchKit/pull/449.patch"},"body":"This PR deals with [Issue #256](https://github.com/ResearchKit/ResearchKit/issues/256).\r\n\r\nIt adds four logging levels:\r\n- `ORK_LOG_LEVEL_NONE`\r\n- `ORK_LOG_LEVEL_DEBUG`, `ORK_Log_Debug()`\r\n- `ORK_LOG_LEVEL_WARNING`, `ORK_Log_Warning()`\r\n- `ORK_LOG_LEVEL_ERROR`, `ORK_Log_Error()`\r\n\r\nAlso:\r\n- Changes some (mildly) serious error messages from the `DEBUG` to the `WARNING` level. Please let me know if any of these promotions should be avoided, or if any of those should be promoted to the `ERROR` level.\r\n- Remove the line number from logging as it's noisy (we already have the function name).\r\n\r\nI figured these three levels are more than enough, but let me know if you prefer to have more levels such as  `Emergency`, `Alert`, `Critical`, `Notice` or `Info`, as explained [here](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/LoggingErrorsAndWarnings.html#//apple_ref/doc/uid/10000172i-SW8-SW3).\r\n\r\n---\r\n\r\nThis is the documentation, which I added as a new section to the *ResearchKit Framework Programming Guide*:\r\n\r\n## Logging Errors and Warnings\r\n\r\nThe ResearchKit framework supports four log levels, controlled by four preprocessor macros and their corresponding *`NSLog()`-like* logging macros:\r\n* `ORK_LOG_LEVEL_NONE`\r\n* `ORK_LOG_LEVEL_DEBUG`, `ORK_Log_Debug()`\r\n* `ORK_LOG_LEVEL_WARNING`, `ORK_Log_Warning()`\r\n* `ORK_LOG_LEVEL_ERROR`, `ORK_Log_Error()`\r\n\r\nSetting the ResearchKit's framework `ORK_LOG_LEVEL_NONE` macro to `1` completely silences all ResearchKit logs, overriding any other specified log level. Setting `ORK_LOG_LEVEL_DEBUG`, `ORK_LOG_LEVEL_WARNING`, or `ORK_LOG_LEVEL_ERROR` to `1` enables logging at that level and at those of higher seriousness.\r\n\r\nIf you do not explicitly set a log level, `ORK_LOG_LEVEL_WARNING=1` is used by default.\r\n\r\nYou have to set any of these preprocessor macros in your ResearchKit subproject, not in your main project. Within *Xcode*, you can do so by setting any of them in the `Preprocessor Macros` list on the `Build Settings` of your `ResearchKit` framework target.\r\n\r\nSee these resources if you are using ResearchKit through CocoaPods and need to change the log level: [[1]](http://stackoverflow.com/a/30038120/269753) [[2]](http://www.mokacoding.com/blog/cocoapods-and-custom-build-configurations/).\r\n"},"comment":{"url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/comments/139386868","html_url":"https://github.com/ResearchKit/ResearchKit/pull/449#issuecomment-139386868","issue_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/449","id":139386868,"user":{"login":"p2","id":358485,"avatar_url":"https://avatars.githubusercontent.com/u/358485?v=3","gravatar_id":"","url":"https://api.github.com/users/p2","html_url":"https://github.com/p2","followers_url":"https://api.github.com/users/p2/followers","following_url":"https://api.github.com/users/p2/following{/other_user}","gists_url":"https://api.github.com/users/p2/gists{/gist_id}","starred_url":"https://api.github.com/users/p2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p2/subscriptions","organizations_url":"https://api.github.com/users/p2/orgs","repos_url":"https://api.github.com/users/p2/repos","events_url":"https://api.github.com/users/p2/events{/privacy}","received_events_url":"https://api.github.com/users/p2/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T21:39:58Z","updated_at":"2015-09-10T21:39:58Z","body":"Different preferences I guess; I only log file name and line number. :) In this case we should definitely go with your preference, given all your work already and me not having a solid argument, other than taste."}}