{"action":"created","issue":{"url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/545","labels_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/545/comments","events_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/545/events","html_url":"https://github.com/magicalpanda/MagicalRecord/issues/545","id":18350101,"number":545,"title":"Update podspec to let user choose if logs are ON or OFF","user":{"login":"AliSoftware","id":216089,"avatar_url":"https://avatars.githubusercontent.com/u/216089?v=3","gravatar_id":"","url":"https://api.github.com/users/AliSoftware","html_url":"https://github.com/AliSoftware","followers_url":"https://api.github.com/users/AliSoftware/followers","following_url":"https://api.github.com/users/AliSoftware/following{/other_user}","gists_url":"https://api.github.com/users/AliSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/AliSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliSoftware/subscriptions","organizations_url":"https://api.github.com/users/AliSoftware/orgs","repos_url":"https://api.github.com/users/AliSoftware/repos","events_url":"https://api.github.com/users/AliSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/AliSoftware/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magicalpanda/MagicalRecord/labels/Feature%20Request","name":"Feature Request","color":"009900"}],"state":"closed","locked":false,"assignee":{"login":"tonyarnold","id":4802,"avatar_url":"https://avatars.githubusercontent.com/u/4802?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyarnold","html_url":"https://github.com/tonyarnold","followers_url":"https://api.github.com/users/tonyarnold/followers","following_url":"https://api.github.com/users/tonyarnold/following{/other_user}","gists_url":"https://api.github.com/users/tonyarnold/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyarnold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyarnold/subscriptions","organizations_url":"https://api.github.com/users/tonyarnold/orgs","repos_url":"https://api.github.com/users/tonyarnold/repos","events_url":"https://api.github.com/users/tonyarnold/events{/privacy}","received_events_url":"https://api.github.com/users/tonyarnold/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/magicalpanda/MagicalRecord/milestones/7","labels_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/milestones/7/labels","id":241204,"number":7,"title":"2.3.0","description":"","creator":{"login":"tonyarnold","id":4802,"avatar_url":"https://avatars.githubusercontent.com/u/4802?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyarnold","html_url":"https://github.com/tonyarnold","followers_url":"https://api.github.com/users/tonyarnold/followers","following_url":"https://api.github.com/users/tonyarnold/following{/other_user}","gists_url":"https://api.github.com/users/tonyarnold/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyarnold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyarnold/subscriptions","organizations_url":"https://api.github.com/users/tonyarnold/orgs","repos_url":"https://api.github.com/users/tonyarnold/repos","events_url":"https://api.github.com/users/tonyarnold/events{/privacy}","received_events_url":"https://api.github.com/users/tonyarnold/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":136,"state":"open","created_at":"2013-01-09T08:44:16Z","updated_at":"2015-01-24T13:20:58Z","due_on":"2014-11-27T13:00:00Z","closed_at":null},"comments":17,"created_at":"2013-08-21T12:10:52Z","updated_at":"2015-01-27T13:07:09Z","closed_at":"2014-04-08T13:02:46Z","body":"Each time I do a `pod update` on my project, [Cocoapods](http://cocoapods.org/) retrieve the `MagicalRecord` pod without its `#define MR_ENABLE_ACTIVE_RECORD_LOGGING 0` set in its `Pods-{TargetName}-MagicalRecord-prefix.pch` files so I have to edit all those `.pch` files to disable the logs after each `pod update`.\r\n\r\nWould it be possible to use supspecs so that the user can select if he wants to retreive MagicalRecord with logs ON or OFF by default?\r\n\r\n---\r\n\r\nSomething maybe like this in the `MagicalRecord.podspec` should do the trick (not tested):\r\n\r\n```ruby\r\ns.prefix_header_contents = <<-EOS\r\n#ifdef __OBJC__\r\n#define MR_SHORTHAND\r\n#import \"MagicalRecordConfig.h\" // Import the config depending on the subspec\r\n#import \"CoreData+MagicalRecord.h\"\r\n#endif\r\nEOS\r\n\r\ns.default_subspec 'logsOn'\r\ns.subspec 'logsOn' do |sp|\r\n  s.source_files 'Configs/LogsOn/MagicalRecordConfig.h' // Use this MagicalRecordConfig.h file to turn logs ON\r\nend\r\ns.subspec 'logsOff' do |sp|\r\n  s.source_files 'Configs/LogsOff/MagicalRecordConfig.h' // Use this MagicalRecordConfig.h file to turn logs OFF\r\nend\r\n```\r\nAnd of course adding to the source repo a `Config/LogsOn/MagicalRecordConfig.h` file with `#define MR_ENABLE_ACTIVE_RECORD_LOGGING 1` in it and a `Config/LogsOff/MagicalRecordConfig.h` file with `#define MR_ENABLE_ACTIVE_RECORD_LOGGING 0` in it.\r\n\r\n---\r\n\r\nThis way, users can either specify `pod 'MagicalRecord/logsOn'` or `pod 'MagicalRecord/logsOff'` in their `Podfile`. (`pod 'MagicalRecord'` will defaults to same as `pod 'MagicalRecord/logsOn'`)."},"comment":{"url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/comments/71644674","html_url":"https://github.com/magicalpanda/MagicalRecord/issues/545#issuecomment-71644674","issue_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/545","id":71644674,"user":{"login":"Alydyn","id":4280700,"avatar_url":"https://avatars.githubusercontent.com/u/4280700?v=3","gravatar_id":"","url":"https://api.github.com/users/Alydyn","html_url":"https://github.com/Alydyn","followers_url":"https://api.github.com/users/Alydyn/followers","following_url":"https://api.github.com/users/Alydyn/following{/other_user}","gists_url":"https://api.github.com/users/Alydyn/gists{/gist_id}","starred_url":"https://api.github.com/users/Alydyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alydyn/subscriptions","organizations_url":"https://api.github.com/users/Alydyn/orgs","repos_url":"https://api.github.com/users/Alydyn/repos","events_url":"https://api.github.com/users/Alydyn/events{/privacy}","received_events_url":"https://api.github.com/users/Alydyn/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T13:07:09Z","updated_at":"2015-01-27T13:07:09Z","body":"@AliSoftware I just checked the headers for MR v2.3beta5 and it includes the method he references:\r\nhttps://github.com/magicalpanda/MagicalRecord/blob/v2.3.0-beta.5/MagicalRecord/Core/MagicalRecord%2BOptions.h#L146\r\n\r\nI believe he can get that version with CocoaPods by following the link in my previous comment."}}