motion-yapper 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (348) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.travis.yml +6 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +63 -0
  6. data/README.md +16 -0
  7. data/Rakefile +20 -0
  8. data/app/app_delegate.rb +5 -0
  9. data/lib/yapper.rb +30 -0
  10. data/lib/yapper/attachment.rb +48 -0
  11. data/lib/yapper/bson.rb +20 -0
  12. data/lib/yapper/config.rb +18 -0
  13. data/lib/yapper/db.rb +151 -0
  14. data/lib/yapper/document.rb +54 -0
  15. data/lib/yapper/document/attachment.rb +26 -0
  16. data/lib/yapper/document/callbacks.rb +86 -0
  17. data/lib/yapper/document/persistance.rb +171 -0
  18. data/lib/yapper/document/relation.rb +84 -0
  19. data/lib/yapper/document/selection.rb +100 -0
  20. data/lib/yapper/extensions.rb +80 -0
  21. data/lib/yapper/log.rb +5 -0
  22. data/lib/yapper/sync.rb +134 -0
  23. data/lib/yapper/sync/data.rb +12 -0
  24. data/lib/yapper/sync/event.rb +194 -0
  25. data/lib/yapper/sync/queue.rb +164 -0
  26. data/lib/yapper/timestamps.rb +16 -0
  27. data/lib/yapper/version.rb +3 -0
  28. data/lib/yapper/yapper.rb +2 -0
  29. data/spec/helpers/time_helper.rb +3 -0
  30. data/spec/integration/all_spec.rb +40 -0
  31. data/spec/integration/callback_spec.rb +87 -0
  32. data/spec/integration/db_spec.rb +40 -0
  33. data/spec/integration/find_spec.rb +51 -0
  34. data/spec/integration/persistance_spec.rb +118 -0
  35. data/spec/integration/relation_spec.rb +174 -0
  36. data/spec/integration/sync_spec.rb +42 -0
  37. data/spec/integration/timestamps_spec.rb +34 -0
  38. data/spec/integration/types_spec.rb +23 -0
  39. data/spec/integration/when_spec.rb +29 -0
  40. data/spec/integration/where_spec.rb +132 -0
  41. data/vendor/Podfile.lock +24 -0
  42. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +641 -0
  43. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +1396 -0
  44. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +133 -0
  45. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +327 -0
  46. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +113 -0
  47. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +321 -0
  48. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +71 -0
  49. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +150 -0
  50. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
  51. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +157 -0
  52. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +43 -0
  53. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +68 -0
  54. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +143 -0
  55. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +370 -0
  56. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +848 -0
  57. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +89 -0
  58. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +167 -0
  59. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +78 -0
  60. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +191 -0
  61. data/vendor/Pods/AFNetworking/LICENSE +19 -0
  62. data/vendor/Pods/AFNetworking/README.md +208 -0
  63. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +641 -0
  64. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +133 -0
  65. data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +113 -0
  66. data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +71 -0
  67. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
  68. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +43 -0
  69. data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +68 -0
  70. data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +370 -0
  71. data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +89 -0
  72. data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +78 -0
  73. data/vendor/Pods/BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
  74. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +41 -0
  75. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
  76. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +334 -0
  77. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +601 -0
  78. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +167 -0
  79. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
  80. data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
  81. data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +109 -0
  82. data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +90 -0
  83. data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +20 -0
  84. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +547 -0
  85. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +447 -0
  86. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +29 -0
  87. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +37 -0
  88. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +15 -0
  89. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
  90. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
  91. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
  92. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +108 -0
  93. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
  94. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
  95. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
  96. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
  97. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
  98. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
  99. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
  100. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
  101. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +158 -0
  102. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +17 -0
  103. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +424 -0
  104. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +42 -0
  105. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
  106. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
  107. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
  108. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
  109. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
  110. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +13 -0
  111. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +121 -0
  112. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +541 -0
  113. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +186 -0
  114. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +272 -0
  115. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
  116. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +115 -0
  117. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +825 -0
  118. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
  119. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +56 -0
  120. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +36 -0
  121. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
  122. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +153 -0
  123. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
  124. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
  125. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +447 -0
  126. data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +74 -0
  127. data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +17 -0
  128. data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +41 -0
  129. data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +15 -0
  130. data/vendor/Pods/CocoaLumberjack/LICENSE.txt +18 -0
  131. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +41 -0
  132. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +99 -0
  133. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +102 -0
  134. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +727 -0
  135. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +334 -0
  136. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1353 -0
  137. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +601 -0
  138. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +1083 -0
  139. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +167 -0
  140. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1479 -0
  141. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
  142. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
  143. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
  144. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
  145. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +7 -0
  146. data/vendor/Pods/CocoaLumberjack/README.markdown +37 -0
  147. data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +641 -0
  148. data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +133 -0
  149. data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +113 -0
  150. data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +71 -0
  151. data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
  152. data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +43 -0
  153. data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +68 -0
  154. data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +370 -0
  155. data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +89 -0
  156. data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +78 -0
  157. data/vendor/Pods/Headers/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
  158. data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +41 -0
  159. data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
  160. data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +334 -0
  161. data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +601 -0
  162. data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +167 -0
  163. data/vendor/Pods/Headers/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
  164. data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
  165. data/vendor/Pods/Headers/Reachability/Reachability.h +109 -0
  166. data/vendor/Pods/Headers/YapDatabase/YapCache.h +90 -0
  167. data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +20 -0
  168. data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +547 -0
  169. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +447 -0
  170. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +29 -0
  171. data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +37 -0
  172. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +15 -0
  173. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
  174. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
  175. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
  176. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +108 -0
  177. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
  178. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
  179. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
  180. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
  181. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
  182. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
  183. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
  184. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
  185. data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +158 -0
  186. data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +17 -0
  187. data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +424 -0
  188. data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +42 -0
  189. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
  190. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
  191. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
  192. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
  193. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
  194. data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +13 -0
  195. data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +121 -0
  196. data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +541 -0
  197. data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +186 -0
  198. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +272 -0
  199. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
  200. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +115 -0
  201. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +825 -0
  202. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
  203. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +56 -0
  204. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +36 -0
  205. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
  206. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +153 -0
  207. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
  208. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
  209. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +447 -0
  210. data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +74 -0
  211. data/vendor/Pods/Headers/YapDatabase/YapNull.h +17 -0
  212. data/vendor/Pods/Headers/YapDatabase/YapSet.h +41 -0
  213. data/vendor/Pods/Headers/YapDatabase/YapTouch.h +15 -0
  214. data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +17 -0
  215. data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +5 -0
  216. data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +5 -0
  217. data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +5 -0
  218. data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +5 -0
  219. data/vendor/Pods/Headers/____Pods-environment.h +38 -0
  220. data/vendor/Pods/Manifest.lock +24 -0
  221. data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
  222. data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +39 -0
  223. data/vendor/Pods/NSData+MD5Digest/README.md +11 -0
  224. data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +5 -0
  225. data/vendor/Pods/Pods-AFNetworking-dummy.m +5 -0
  226. data/vendor/Pods/Pods-AFNetworking-prefix.pch +17 -0
  227. data/vendor/Pods/Pods-AFNetworking.xcconfig +1 -0
  228. data/vendor/Pods/Pods-Acknowledgements.markdown +96 -0
  229. data/vendor/Pods/Pods-Acknowledgements.plist +142 -0
  230. data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +5 -0
  231. data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +5 -0
  232. data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +5 -0
  233. data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
  234. data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +5 -0
  235. data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +5 -0
  236. data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +5 -0
  237. data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
  238. data/vendor/Pods/Pods-Reachability-Private.xcconfig +5 -0
  239. data/vendor/Pods/Pods-Reachability-dummy.m +5 -0
  240. data/vendor/Pods/Pods-Reachability-prefix.pch +5 -0
  241. data/vendor/Pods/Pods-Reachability.xcconfig +1 -0
  242. data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +5 -0
  243. data/vendor/Pods/Pods-YapDatabase-dummy.m +5 -0
  244. data/vendor/Pods/Pods-YapDatabase-prefix.pch +5 -0
  245. data/vendor/Pods/Pods-YapDatabase.xcconfig +1 -0
  246. data/vendor/Pods/Pods-dummy.m +5 -0
  247. data/vendor/Pods/Pods-environment.h +38 -0
  248. data/vendor/Pods/Pods-resources.sh +68 -0
  249. data/vendor/Pods/Pods.bridgesupport +5096 -0
  250. data/vendor/Pods/Pods.xcconfig +5 -0
  251. data/vendor/Pods/Pods.xcodeproj/project.pbxproj +5536 -0
  252. data/vendor/Pods/Reachability/LICENCE.txt +24 -0
  253. data/vendor/Pods/Reachability/README.md +65 -0
  254. data/vendor/Pods/Reachability/Reachability.h +109 -0
  255. data/vendor/Pods/Reachability/Reachability.m +527 -0
  256. data/vendor/Pods/YapDatabase/LICENSE.txt +18 -0
  257. data/vendor/Pods/YapDatabase/README.md +30 -0
  258. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +19 -0
  259. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +108 -0
  260. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +175 -0
  261. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +12 -0
  262. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +41 -0
  263. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +39 -0
  264. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +966 -0
  265. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +69 -0
  266. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +89 -0
  267. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +146 -0
  268. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +32 -0
  269. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +298 -0
  270. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
  271. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +95 -0
  272. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +68 -0
  273. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +1352 -0
  274. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +440 -0
  275. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +15 -0
  276. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +58 -0
  277. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +11 -0
  278. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +46 -0
  279. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +11 -0
  280. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +180 -0
  281. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +73 -0
  282. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +100 -0
  283. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +149 -0
  284. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +33 -0
  285. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +330 -0
  286. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +33 -0
  287. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +184 -0
  288. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +58 -0
  289. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +1166 -0
  290. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +94 -0
  291. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +72 -0
  292. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +36 -0
  293. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +296 -0
  294. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +27 -0
  295. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +28 -0
  296. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +153 -0
  297. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +17 -0
  298. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +272 -0
  299. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +2494 -0
  300. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +825 -0
  301. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +1567 -0
  302. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +330 -0
  303. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +141 -0
  304. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +186 -0
  305. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +191 -0
  306. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +115 -0
  307. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +897 -0
  308. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +56 -0
  309. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +27 -0
  310. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +447 -0
  311. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +4505 -0
  312. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +90 -0
  313. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +453 -0
  314. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +29 -0
  315. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +48 -0
  316. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +37 -0
  317. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +83 -0
  318. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +158 -0
  319. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +73 -0
  320. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +17 -0
  321. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +56 -0
  322. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +424 -0
  323. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +13 -0
  324. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +26 -0
  325. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +121 -0
  326. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +74 -0
  327. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +603 -0
  328. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +17 -0
  329. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +31 -0
  330. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +15 -0
  331. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +31 -0
  332. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +20 -0
  333. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +194 -0
  334. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +42 -0
  335. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +96 -0
  336. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +41 -0
  337. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +82 -0
  338. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +547 -0
  339. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +2022 -0
  340. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +447 -0
  341. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +3874 -0
  342. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +541 -0
  343. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +5282 -0
  344. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -0
  345. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +13 -0
  346. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -0
  347. data/yapper.gemspec +24 -0
  348. metadata +458 -0
@@ -0,0 +1,601 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ /**
4
+ * Welcome to Cocoa Lumberjack!
5
+ *
6
+ * The project page has a wealth of documentation if you have any questions.
7
+ * https://github.com/robbiehanson/CocoaLumberjack
8
+ *
9
+ * If you're new to the project you may wish to read the "Getting Started" wiki.
10
+ * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
11
+ *
12
+ * Otherwise, here is a quick refresher.
13
+ * There are three steps to using the macros:
14
+ *
15
+ * Step 1:
16
+ * Import the header in your implementation file:
17
+ *
18
+ * #import "DDLog.h"
19
+ *
20
+ * Step 2:
21
+ * Define your logging level in your implementation file:
22
+ *
23
+ * // Log levels: off, error, warn, info, verbose
24
+ * static const int ddLogLevel = LOG_LEVEL_VERBOSE;
25
+ *
26
+ * Step 3:
27
+ * Replace your NSLog statements with DDLog statements according to the severity of the message.
28
+ *
29
+ * NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!");
30
+ *
31
+ * DDLog works exactly the same as NSLog.
32
+ * This means you can pass it multiple variables just like NSLog.
33
+ **/
34
+
35
+
36
+ @class DDLogMessage;
37
+
38
+ @protocol DDLogger;
39
+ @protocol DDLogFormatter;
40
+
41
+ /**
42
+ * This is the single macro that all other macros below compile into.
43
+ * This big multiline macro makes all the other macros easier to read.
44
+ **/
45
+
46
+ #define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \
47
+ [DDLog log:isAsynchronous \
48
+ level:lvl \
49
+ flag:flg \
50
+ context:ctx \
51
+ file:__FILE__ \
52
+ function:fnct \
53
+ line:__LINE__ \
54
+ tag:atag \
55
+ format:(frmt), ##__VA_ARGS__]
56
+
57
+ /**
58
+ * Define the Objective-C and C versions of the macro.
59
+ * These automatically inject the proper function name for either an objective-c method or c function.
60
+ *
61
+ * We also define shorthand versions for asynchronous and synchronous logging.
62
+ **/
63
+
64
+ #define LOG_OBJC_MACRO(async, lvl, flg, ctx, frmt, ...) \
65
+ LOG_MACRO(async, lvl, flg, ctx, nil, sel_getName(_cmd), frmt, ##__VA_ARGS__)
66
+
67
+ #define LOG_C_MACRO(async, lvl, flg, ctx, frmt, ...) \
68
+ LOG_MACRO(async, lvl, flg, ctx, nil, __FUNCTION__, frmt, ##__VA_ARGS__)
69
+
70
+ #define SYNC_LOG_OBJC_MACRO(lvl, flg, ctx, frmt, ...) \
71
+ LOG_OBJC_MACRO( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
72
+
73
+ #define ASYNC_LOG_OBJC_MACRO(lvl, flg, ctx, frmt, ...) \
74
+ LOG_OBJC_MACRO(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
75
+
76
+ #define SYNC_LOG_C_MACRO(lvl, flg, ctx, frmt, ...) \
77
+ LOG_C_MACRO( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
78
+
79
+ #define ASYNC_LOG_C_MACRO(lvl, flg, ctx, frmt, ...) \
80
+ LOG_C_MACRO(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
81
+
82
+ /**
83
+ * Define version of the macro that only execute if the logLevel is above the threshold.
84
+ * The compiled versions essentially look like this:
85
+ *
86
+ * if (logFlagForThisLogMsg & ddLogLevel) { execute log message }
87
+ *
88
+ * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels.
89
+ * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques.
90
+ *
91
+ * Note that when compiler optimizations are enabled (as they are for your release builds),
92
+ * the log messages above your logging threshold will automatically be compiled out.
93
+ *
94
+ * (If the compiler sees ddLogLevel declared as a constant, the compiler simply checks to see if the 'if' statement
95
+ * would execute, and if not it strips it from the binary.)
96
+ *
97
+ * We also define shorthand versions for asynchronous and synchronous logging.
98
+ **/
99
+
100
+ #define LOG_MAYBE(async, lvl, flg, ctx, fnct, frmt, ...) \
101
+ do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } while(0)
102
+
103
+ #define LOG_OBJC_MAYBE(async, lvl, flg, ctx, frmt, ...) \
104
+ LOG_MAYBE(async, lvl, flg, ctx, sel_getName(_cmd), frmt, ##__VA_ARGS__)
105
+
106
+ #define LOG_C_MAYBE(async, lvl, flg, ctx, frmt, ...) \
107
+ LOG_MAYBE(async, lvl, flg, ctx, __FUNCTION__, frmt, ##__VA_ARGS__)
108
+
109
+ #define SYNC_LOG_OBJC_MAYBE(lvl, flg, ctx, frmt, ...) \
110
+ LOG_OBJC_MAYBE( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
111
+
112
+ #define ASYNC_LOG_OBJC_MAYBE(lvl, flg, ctx, frmt, ...) \
113
+ LOG_OBJC_MAYBE(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
114
+
115
+ #define SYNC_LOG_C_MAYBE(lvl, flg, ctx, frmt, ...) \
116
+ LOG_C_MAYBE( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
117
+
118
+ #define ASYNC_LOG_C_MAYBE(lvl, flg, ctx, frmt, ...) \
119
+ LOG_C_MAYBE(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
120
+
121
+ /**
122
+ * Define versions of the macros that also accept tags.
123
+ *
124
+ * The DDLogMessage object includes a 'tag' ivar that may be used for a variety of purposes.
125
+ * It may be used to pass custom information to loggers or formatters.
126
+ * Or it may be used by 3rd party extensions to the framework.
127
+ *
128
+ * Thes macros just make it a little easier to extend logging functionality.
129
+ **/
130
+
131
+ #define LOG_OBJC_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, ...) \
132
+ LOG_MACRO(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, ##__VA_ARGS__)
133
+
134
+ #define LOG_C_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, ...) \
135
+ LOG_MACRO(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, ##__VA_ARGS__)
136
+
137
+ #define LOG_TAG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \
138
+ do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0)
139
+
140
+ #define LOG_OBJC_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, ...) \
141
+ LOG_TAG_MAYBE(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, ##__VA_ARGS__)
142
+
143
+ #define LOG_C_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, ...) \
144
+ LOG_TAG_MAYBE(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, ##__VA_ARGS__)
145
+
146
+ /**
147
+ * Define the standard options.
148
+ *
149
+ * We default to only 4 levels because it makes it easier for beginners
150
+ * to make the transition to a logging framework.
151
+ *
152
+ * More advanced users may choose to completely customize the levels (and level names) to suite their needs.
153
+ * For more information on this see the "Custom Log Levels" page:
154
+ * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomLogLevels
155
+ *
156
+ * Advanced users may also notice that we're using a bitmask.
157
+ * This is to allow for custom fine grained logging:
158
+ * https://github.com/robbiehanson/CocoaLumberjack/wiki/FineGrainedLogging
159
+ *
160
+ * -- Flags --
161
+ *
162
+ * Typically you will use the LOG_LEVELS (see below), but the flags may be used directly in certain situations.
163
+ * For example, say you have a lot of warning log messages, and you wanted to disable them.
164
+ * However, you still needed to see your error and info log messages.
165
+ * You could accomplish that with the following:
166
+ *
167
+ * static const int ddLogLevel = LOG_FLAG_ERROR | LOG_FLAG_INFO;
168
+ *
169
+ * Flags may also be consulted when writing custom log formatters,
170
+ * as the DDLogMessage class captures the individual flag that caused the log message to fire.
171
+ *
172
+ * -- Levels --
173
+ *
174
+ * Log levels are simply the proper bitmask of the flags.
175
+ *
176
+ * -- Booleans --
177
+ *
178
+ * The booleans may be used when your logging code involves more than one line.
179
+ * For example:
180
+ *
181
+ * if (LOG_VERBOSE) {
182
+ * for (id sprocket in sprockets)
183
+ * DDLogVerbose(@"sprocket: %@", [sprocket description])
184
+ * }
185
+ *
186
+ * -- Async --
187
+ *
188
+ * Defines the default asynchronous options.
189
+ * The default philosophy for asynchronous logging is very simple:
190
+ *
191
+ * Log messages with errors should be executed synchronously.
192
+ * After all, an error just occurred. The application could be unstable.
193
+ *
194
+ * All other log messages, such as debug output, are executed asynchronously.
195
+ * After all, if it wasn't an error, then it was just informational output,
196
+ * or something the application was easily able to recover from.
197
+ *
198
+ * -- Changes --
199
+ *
200
+ * You are strongly discouraged from modifying this file.
201
+ * If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project.
202
+ * Instead, create your own MyLogging.h or ApplicationNameLogging.h or CompanyLogging.h
203
+ *
204
+ * For an example of customizing your logging experience, see the "Custom Log Levels" page:
205
+ * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomLogLevels
206
+ **/
207
+
208
+ #define LOG_FLAG_ERROR (1 << 0) // 0...0001
209
+ #define LOG_FLAG_WARN (1 << 1) // 0...0010
210
+ #define LOG_FLAG_INFO (1 << 2) // 0...0100
211
+ #define LOG_FLAG_VERBOSE (1 << 3) // 0...1000
212
+
213
+ #define LOG_LEVEL_OFF 0
214
+ #define LOG_LEVEL_ERROR (LOG_FLAG_ERROR) // 0...0001
215
+ #define LOG_LEVEL_WARN (LOG_FLAG_ERROR | LOG_FLAG_WARN) // 0...0011
216
+ #define LOG_LEVEL_INFO (LOG_FLAG_ERROR | LOG_FLAG_WARN | LOG_FLAG_INFO) // 0...0111
217
+ #define LOG_LEVEL_VERBOSE (LOG_FLAG_ERROR | LOG_FLAG_WARN | LOG_FLAG_INFO | LOG_FLAG_VERBOSE) // 0...1111
218
+
219
+ #define LOG_ERROR (ddLogLevel & LOG_FLAG_ERROR)
220
+ #define LOG_WARN (ddLogLevel & LOG_FLAG_WARN)
221
+ #define LOG_INFO (ddLogLevel & LOG_FLAG_INFO)
222
+ #define LOG_VERBOSE (ddLogLevel & LOG_FLAG_VERBOSE)
223
+
224
+ #define LOG_ASYNC_ENABLED YES
225
+
226
+ #define LOG_ASYNC_ERROR ( NO && LOG_ASYNC_ENABLED)
227
+ #define LOG_ASYNC_WARN (YES && LOG_ASYNC_ENABLED)
228
+ #define LOG_ASYNC_INFO (YES && LOG_ASYNC_ENABLED)
229
+ #define LOG_ASYNC_VERBOSE (YES && LOG_ASYNC_ENABLED)
230
+
231
+ #define DDLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, ddLogLevel, LOG_FLAG_ERROR, 0, frmt, ##__VA_ARGS__)
232
+ #define DDLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, ddLogLevel, LOG_FLAG_WARN, 0, frmt, ##__VA_ARGS__)
233
+ #define DDLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, ddLogLevel, LOG_FLAG_INFO, 0, frmt, ##__VA_ARGS__)
234
+ #define DDLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, ddLogLevel, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__)
235
+
236
+ #define DDLogCError(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, ddLogLevel, LOG_FLAG_ERROR, 0, frmt, ##__VA_ARGS__)
237
+ #define DDLogCWarn(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_WARN, ddLogLevel, LOG_FLAG_WARN, 0, frmt, ##__VA_ARGS__)
238
+ #define DDLogCInfo(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_INFO, ddLogLevel, LOG_FLAG_INFO, 0, frmt, ##__VA_ARGS__)
239
+ #define DDLogCVerbose(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_VERBOSE, ddLogLevel, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__)
240
+
241
+ /**
242
+ * The THIS_FILE macro gives you an NSString of the file name.
243
+ * For simplicity and clarity, the file name does not include the full path or file extension.
244
+ *
245
+ * For example: DDLogWarn(@"%@: Unable to find thingy", THIS_FILE) -> @"MyViewController: Unable to find thingy"
246
+ **/
247
+
248
+ NSString *DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy);
249
+
250
+ #define THIS_FILE (DDExtractFileNameWithoutExtension(__FILE__, NO))
251
+
252
+ /**
253
+ * The THIS_METHOD macro gives you the name of the current objective-c method.
254
+ *
255
+ * For example: DDLogWarn(@"%@ - Requires non-nil strings", THIS_METHOD) -> @"setMake:model: requires non-nil strings"
256
+ *
257
+ * Note: This does NOT work in straight C functions (non objective-c).
258
+ * Instead you should use the predefined __FUNCTION__ macro.
259
+ **/
260
+
261
+ #define THIS_METHOD NSStringFromSelector(_cmd)
262
+
263
+
264
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
265
+ #pragma mark -
266
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
267
+
268
+ @interface DDLog : NSObject
269
+
270
+ /**
271
+ * Provides access to the underlying logging queue.
272
+ * This may be helpful to Logger classes for things like thread synchronization.
273
+ **/
274
+
275
+ + (dispatch_queue_t)loggingQueue;
276
+
277
+ /**
278
+ * Logging Primitive.
279
+ *
280
+ * This method is used by the macros above.
281
+ * It is suggested you stick with the macros as they're easier to use.
282
+ **/
283
+
284
+ + (void)log:(BOOL)synchronous
285
+ level:(int)level
286
+ flag:(int)flag
287
+ context:(int)context
288
+ file:(const char *)file
289
+ function:(const char *)function
290
+ line:(int)line
291
+ tag:(id)tag
292
+ format:(NSString *)format, ... __attribute__ ((format (__NSString__, 9, 10)));
293
+
294
+ /**
295
+ * Logging Primitive.
296
+ *
297
+ * This method can be used if you have a prepared va_list.
298
+ **/
299
+
300
+ + (void)log:(BOOL)asynchronous
301
+ level:(int)level
302
+ flag:(int)flag
303
+ context:(int)context
304
+ file:(const char *)file
305
+ function:(const char *)function
306
+ line:(int)line
307
+ tag:(id)tag
308
+ format:(NSString *)format
309
+ args:(va_list)argList;
310
+
311
+
312
+ /**
313
+ * Since logging can be asynchronous, there may be times when you want to flush the logs.
314
+ * The framework invokes this automatically when the application quits.
315
+ **/
316
+
317
+ + (void)flushLog;
318
+
319
+ /**
320
+ * Loggers
321
+ *
322
+ * If you want your log statements to go somewhere,
323
+ * you should create and add a logger.
324
+ **/
325
+
326
+ + (void)addLogger:(id <DDLogger>)logger;
327
+ + (void)removeLogger:(id <DDLogger>)logger;
328
+
329
+ + (void)removeAllLoggers;
330
+
331
+ /**
332
+ * Registered Dynamic Logging
333
+ *
334
+ * These methods allow you to obtain a list of classes that are using registered dynamic logging,
335
+ * and also provides methods to get and set their log level during run time.
336
+ **/
337
+
338
+ + (NSArray *)registeredClasses;
339
+ + (NSArray *)registeredClassNames;
340
+
341
+ + (int)logLevelForClass:(Class)aClass;
342
+ + (int)logLevelForClassWithName:(NSString *)aClassName;
343
+
344
+ + (void)setLogLevel:(int)logLevel forClass:(Class)aClass;
345
+ + (void)setLogLevel:(int)logLevel forClassWithName:(NSString *)aClassName;
346
+
347
+ @end
348
+
349
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
350
+ #pragma mark -
351
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
352
+
353
+ @protocol DDLogger <NSObject>
354
+ @required
355
+
356
+ - (void)logMessage:(DDLogMessage *)logMessage;
357
+
358
+ /**
359
+ * Formatters may optionally be added to any logger.
360
+ *
361
+ * If no formatter is set, the logger simply logs the message as it is given in logMessage,
362
+ * or it may use its own built in formatting style.
363
+ **/
364
+ - (id <DDLogFormatter>)logFormatter;
365
+ - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
366
+
367
+ @optional
368
+
369
+ /**
370
+ * Since logging is asynchronous, adding and removing loggers is also asynchronous.
371
+ * In other words, the loggers are added and removed at appropriate times with regards to log messages.
372
+ *
373
+ * - Loggers will not receive log messages that were executed prior to when they were added.
374
+ * - Loggers will not receive log messages that were executed after they were removed.
375
+ *
376
+ * These methods are executed in the logging thread/queue.
377
+ * This is the same thread/queue that will execute every logMessage: invocation.
378
+ * Loggers may use these methods for thread synchronization or other setup/teardown tasks.
379
+ **/
380
+ - (void)didAddLogger;
381
+ - (void)willRemoveLogger;
382
+
383
+ /**
384
+ * Some loggers may buffer IO for optimization purposes.
385
+ * For example, a database logger may only save occasionaly as the disk IO is slow.
386
+ * In such loggers, this method should be implemented to flush any pending IO.
387
+ *
388
+ * This allows invocations of DDLog's flushLog method to be propogated to loggers that need it.
389
+ *
390
+ * Note that DDLog's flushLog method is invoked automatically when the application quits,
391
+ * and it may be also invoked manually by the developer prior to application crashes, or other such reasons.
392
+ **/
393
+ - (void)flush;
394
+
395
+ /**
396
+ * Each logger is executed concurrently with respect to the other loggers.
397
+ * Thus, a dedicated dispatch queue is used for each logger.
398
+ * Logger implementations may optionally choose to provide their own dispatch queue.
399
+ **/
400
+ - (dispatch_queue_t)loggerQueue;
401
+
402
+ /**
403
+ * If the logger implementation does not choose to provide its own queue,
404
+ * one will automatically be created for it.
405
+ * The created queue will receive its name from this method.
406
+ * This may be helpful for debugging or profiling reasons.
407
+ **/
408
+ - (NSString *)loggerName;
409
+
410
+ @end
411
+
412
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
413
+ #pragma mark -
414
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
415
+
416
+ @protocol DDLogFormatter <NSObject>
417
+ @required
418
+
419
+ /**
420
+ * Formatters may optionally be added to any logger.
421
+ * This allows for increased flexibility in the logging environment.
422
+ * For example, log messages for log files may be formatted differently than log messages for the console.
423
+ *
424
+ * For more information about formatters, see the "Custom Formatters" page:
425
+ * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters
426
+ *
427
+ * The formatter may also optionally filter the log message by returning nil,
428
+ * in which case the logger will not log the message.
429
+ **/
430
+ - (NSString *)formatLogMessage:(DDLogMessage *)logMessage;
431
+
432
+ @optional
433
+
434
+ /**
435
+ * A single formatter instance can be added to multiple loggers.
436
+ * These methods provides hooks to notify the formatter of when it's added/removed.
437
+ *
438
+ * This is primarily for thread-safety.
439
+ * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
440
+ * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
441
+ * it could possibly use these hooks to switch to thread-safe versions of the code.
442
+ **/
443
+ - (void)didAddToLogger:(id <DDLogger>)logger;
444
+ - (void)willRemoveFromLogger:(id <DDLogger>)logger;
445
+
446
+ @end
447
+
448
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
449
+ #pragma mark -
450
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
451
+
452
+ @protocol DDRegisteredDynamicLogging
453
+
454
+ /**
455
+ * Implement these methods to allow a file's log level to be managed from a central location.
456
+ *
457
+ * This is useful if you'd like to be able to change log levels for various parts
458
+ * of your code from within the running application.
459
+ *
460
+ * Imagine pulling up the settings for your application,
461
+ * and being able to configure the logging level on a per file basis.
462
+ *
463
+ * The implementation can be very straight-forward:
464
+ *
465
+ * + (int)ddLogLevel
466
+ * {
467
+ * return ddLogLevel;
468
+ * }
469
+ *
470
+ * + (void)ddSetLogLevel:(int)logLevel
471
+ * {
472
+ * ddLogLevel = logLevel;
473
+ * }
474
+ **/
475
+
476
+ + (int)ddLogLevel;
477
+ + (void)ddSetLogLevel:(int)logLevel;
478
+
479
+ @end
480
+
481
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
482
+ #pragma mark -
483
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
484
+
485
+ /**
486
+ * The DDLogMessage class encapsulates information about the log message.
487
+ * If you write custom loggers or formatters, you will be dealing with objects of this class.
488
+ **/
489
+
490
+ enum {
491
+ DDLogMessageCopyFile = 1 << 0,
492
+ DDLogMessageCopyFunction = 1 << 1
493
+ };
494
+ typedef int DDLogMessageOptions;
495
+
496
+ @interface DDLogMessage : NSObject
497
+ {
498
+
499
+ // The public variables below can be accessed directly (for speed).
500
+ // For example: logMessage->logLevel
501
+
502
+ @public
503
+ int logLevel;
504
+ int logFlag;
505
+ int logContext;
506
+ NSString *logMsg;
507
+ NSDate *timestamp;
508
+ char *file;
509
+ char *function;
510
+ int lineNumber;
511
+ mach_port_t machThreadID;
512
+ char *queueLabel;
513
+ NSString *threadName;
514
+
515
+ // For 3rd party extensions to the framework, where flags and contexts aren't enough.
516
+ id tag;
517
+
518
+ // For 3rd party extensions that manually create DDLogMessage instances.
519
+ DDLogMessageOptions options;
520
+ }
521
+
522
+ /**
523
+ * Standard init method for a log message object.
524
+ * Used by the logging primitives. (And the macros use the logging primitives.)
525
+ *
526
+ * If you find need to manually create logMessage objects, there is one thing you should be aware of:
527
+ *
528
+ * If no flags are passed, the method expects the file and function parameters to be string literals.
529
+ * That is, it expects the given strings to exist for the duration of the object's lifetime,
530
+ * and it expects the given strings to be immutable.
531
+ * In other words, it does not copy these strings, it simply points to them.
532
+ * This is due to the fact that __FILE__ and __FUNCTION__ are usually used to specify these parameters,
533
+ * so it makes sense to optimize and skip the unnecessary allocations.
534
+ * However, if you need them to be copied you may use the options parameter to specify this.
535
+ * Options is a bitmask which supports DDLogMessageCopyFile and DDLogMessageCopyFunction.
536
+ **/
537
+ - (id)initWithLogMsg:(NSString *)logMsg
538
+ level:(int)logLevel
539
+ flag:(int)logFlag
540
+ context:(int)logContext
541
+ file:(const char *)file
542
+ function:(const char *)function
543
+ line:(int)line
544
+ tag:(id)tag
545
+ options:(DDLogMessageOptions)optionsMask;
546
+
547
+ /**
548
+ * Returns the threadID as it appears in NSLog.
549
+ * That is, it is a hexadecimal value which is calculated from the machThreadID.
550
+ **/
551
+ - (NSString *)threadID;
552
+
553
+ /**
554
+ * Convenience property to get just the file name, as the file variable is generally the full file path.
555
+ * This method does not include the file extension, which is generally unwanted for logging purposes.
556
+ **/
557
+ - (NSString *)fileName;
558
+
559
+ /**
560
+ * Returns the function variable in NSString form.
561
+ **/
562
+ - (NSString *)methodName;
563
+
564
+ @end
565
+
566
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
567
+ #pragma mark -
568
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
569
+
570
+ /**
571
+ * The DDLogger protocol specifies that an optional formatter can be added to a logger.
572
+ * Most (but not all) loggers will want to support formatters.
573
+ *
574
+ * However, writting getters and setters in a thread safe manner,
575
+ * while still maintaining maximum speed for the logging process, is a difficult task.
576
+ *
577
+ * To do it right, the implementation of the getter/setter has strict requiremenets:
578
+ * - Must NOT require the logMessage method to acquire a lock.
579
+ * - Must NOT require the logMessage method to access an atomic property (also a lock of sorts).
580
+ *
581
+ * To simplify things, an abstract logger is provided that implements the getter and setter.
582
+ *
583
+ * Logger implementations may simply extend this class,
584
+ * and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their logMessage method!
585
+ **/
586
+
587
+ @interface DDAbstractLogger : NSObject <DDLogger>
588
+ {
589
+ id <DDLogFormatter> formatter;
590
+
591
+ dispatch_queue_t loggerQueue;
592
+ }
593
+
594
+ - (id <DDLogFormatter>)logFormatter;
595
+ - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
596
+
597
+ // For thread-safety assertions
598
+ - (BOOL)isOnGlobalLoggingQueue;
599
+ - (BOOL)isOnInternalLoggerQueue;
600
+
601
+ @end