motion-yapper 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.travis.yml +2 -0
  4. data/Gemfile +1 -0
  5. data/README.md +1 -1
  6. data/Rakefile +1 -1
  7. data/lib/motion-yapper.rb +1 -0
  8. data/lib/yapper.rb +3 -5
  9. data/lib/yapper/config.rb +2 -0
  10. data/lib/yapper/db.rb +105 -40
  11. data/lib/yapper/document.rb +7 -4
  12. data/lib/yapper/document/callbacks.rb +0 -7
  13. data/lib/yapper/document/{persistance.rb → persistence.rb} +27 -21
  14. data/lib/yapper/document/relation.rb +29 -22
  15. data/lib/yapper/document/selection.rb +122 -54
  16. data/lib/yapper/extensions.rb +12 -24
  17. data/lib/yapper/settings.rb +43 -0
  18. data/lib/yapper/timestamps.rb +2 -0
  19. data/lib/yapper/version.rb +1 -1
  20. data/{yapper.gemspec → motion-yapper.gemspec} +0 -0
  21. data/spec/integration/{where_spec.rb → criteria_spec.rb} +78 -10
  22. data/spec/integration/db_spec.rb +70 -0
  23. data/spec/integration/defaults_spec.rb +37 -0
  24. data/spec/integration/extensions_spec.rb +14 -0
  25. data/spec/integration/{persistance_spec.rb → persistence_spec.rb} +0 -0
  26. data/spec/integration/relation_spec.rb +4 -4
  27. data/vendor/Podfile.lock +9 -11
  28. data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
  29. data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
  30. data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
  31. data/vendor/Pods/.build/libPods.a +0 -0
  32. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +4 -4
  33. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
  34. data/vendor/Pods/{CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h → BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h} +6 -8
  35. data/vendor/Pods/BuildHeaders/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  36. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +67 -32
  37. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +99 -0
  38. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +98 -65
  39. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +30 -0
  40. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +39 -25
  41. data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +8 -0
  42. data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +1 -0
  43. data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +3 -0
  44. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +4 -4
  45. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +21 -19
  46. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +1 -1
  47. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +35 -31
  48. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +8 -35
  49. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -2
  50. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
  51. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
  52. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +8 -0
  53. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +43 -21
  54. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +35 -0
  55. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
  56. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
  57. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +79 -0
  58. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
  59. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
  60. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +125 -0
  61. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
  62. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
  63. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +10 -0
  64. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
  65. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +131 -21
  66. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +48 -107
  67. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +2 -2
  68. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +1 -0
  69. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +17 -0
  70. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +10 -3
  71. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +18 -1
  72. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +75 -24
  73. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +99 -0
  74. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +4 -4
  75. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +51 -50
  76. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +14 -14
  77. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +546 -546
  78. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +67 -32
  79. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1093 -907
  80. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +99 -0
  81. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +98 -65
  82. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +873 -748
  83. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +39 -25
  84. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1284 -1243
  85. data/vendor/Pods/{BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h → CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h} +6 -8
  86. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{ContextFilterLogFormatter.m → DDContextFilterLogFormatter.m} +70 -70
  87. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  88. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +253 -0
  89. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +30 -0
  90. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +127 -0
  91. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +1 -1
  92. data/vendor/Pods/CocoaLumberjack/README.markdown +52 -15
  93. data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +4 -4
  94. data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
  95. data/vendor/Pods/Headers/CocoaLumberjack/{ContextFilterLogFormatter.h → DDContextFilterLogFormatter.h} +6 -8
  96. data/vendor/Pods/Headers/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  97. data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +67 -32
  98. data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +99 -0
  99. data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +98 -65
  100. data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +30 -0
  101. data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +39 -25
  102. data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +3 -0
  103. data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +4 -4
  104. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +21 -19
  105. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +8 -35
  106. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
  107. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
  108. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +35 -0
  109. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
  110. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
  111. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
  112. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
  113. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
  114. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
  115. data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +131 -21
  116. data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +48 -107
  117. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +2 -2
  118. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +1 -0
  119. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +17 -0
  120. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +10 -3
  121. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +75 -24
  122. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +99 -0
  123. data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +2 -0
  124. data/vendor/Pods/Headers/____Pods-environment.h +15 -15
  125. data/vendor/Pods/Manifest.lock +9 -11
  126. data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +1 -1
  127. data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +2 -0
  128. data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +1 -1
  129. data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +1 -1
  130. data/vendor/Pods/{Pods-Acknowledgements.markdown → Pods-acknowledgements.markdown} +0 -37
  131. data/vendor/Pods/{Pods-Acknowledgements.plist → Pods-acknowledgements.plist} +0 -45
  132. data/vendor/Pods/Pods-environment.h +15 -15
  133. data/vendor/Pods/Pods.xcconfig +3 -3
  134. data/vendor/Pods/Pods.xcodeproj/project.pbxproj +2426 -3155
  135. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +59 -0
  136. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +59 -0
  137. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +59 -0
  138. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +59 -0
  139. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
  140. data/vendor/Pods/YapDatabase/README.md +3 -1
  141. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -2
  142. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +8 -35
  143. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +25 -41
  144. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +17 -17
  145. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +403 -134
  146. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +32 -0
  147. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +8 -0
  148. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +8 -8
  149. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +113 -62
  150. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +35 -31
  151. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +25 -0
  152. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +1 -1
  153. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +25 -1
  154. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +79 -0
  155. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +125 -0
  156. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +35 -0
  157. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +129 -0
  158. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +29 -0
  159. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +802 -0
  160. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +163 -0
  161. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +408 -0
  162. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +99 -0
  163. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +59 -0
  164. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +29 -0
  165. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +384 -0
  166. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +5254 -0
  167. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +10 -0
  168. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
  169. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +49 -0
  170. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +12 -0
  171. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +9 -8
  172. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +62 -1
  173. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +148 -45
  174. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +18 -1
  175. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +2 -2
  176. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +15 -9
  177. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +17 -0
  178. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +211 -64
  179. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +48 -107
  180. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +10 -7
  181. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +1 -0
  182. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +13 -22
  183. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +10 -3
  184. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +75 -24
  185. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +725 -244
  186. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +99 -0
  187. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +8 -0
  188. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +19 -0
  189. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +1 -0
  190. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +12 -0
  191. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +1 -1
  192. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +3 -3
  193. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +43 -21
  194. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +4 -0
  195. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +3 -0
  196. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +5 -0
  197. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +4 -4
  198. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +84 -93
  199. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +21 -19
  200. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +381 -209
  201. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +131 -21
  202. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +587 -267
  203. data/vendor/Pods/{Pods.bridgesupport → build-iPhoneSimulator/Pods.bridgesupport} +633 -2557
  204. data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
  205. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +2 -1
  206. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +2 -1
  207. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +4 -2
  208. metadata +80 -108
  209. data/Gemfile.lock +0 -63
  210. data/lib/yapper/attachment.rb +0 -48
  211. data/lib/yapper/document/attachment.rb +0 -26
  212. data/lib/yapper/sync.rb +0 -134
  213. data/lib/yapper/sync/data.rb +0 -12
  214. data/lib/yapper/sync/event.rb +0 -194
  215. data/lib/yapper/sync/queue.rb +0 -164
  216. data/spec/integration/all_spec.rb +0 -40
  217. data/spec/integration/sync_spec.rb +0 -42
  218. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +0 -641
  219. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +0 -1396
  220. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +0 -133
  221. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +0 -327
  222. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +0 -113
  223. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +0 -321
  224. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +0 -71
  225. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +0 -150
  226. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  227. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +0 -157
  228. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +0 -43
  229. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  230. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +0 -143
  231. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +0 -370
  232. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +0 -848
  233. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +0 -89
  234. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +0 -167
  235. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +0 -78
  236. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +0 -191
  237. data/vendor/Pods/AFNetworking/LICENSE +0 -19
  238. data/vendor/Pods/AFNetworking/README.md +0 -208
  239. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +0 -641
  240. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +0 -133
  241. data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +0 -113
  242. data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +0 -71
  243. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  244. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +0 -43
  245. data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  246. data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +0 -370
  247. data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +0 -89
  248. data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +0 -78
  249. data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +0 -109
  250. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +0 -251
  251. data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +0 -641
  252. data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +0 -133
  253. data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +0 -113
  254. data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +0 -71
  255. data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  256. data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +0 -43
  257. data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  258. data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +0 -370
  259. data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +0 -89
  260. data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +0 -78
  261. data/vendor/Pods/Headers/Reachability/Reachability.h +0 -109
  262. data/vendor/Pods/Headers/YapDatabase/YapCache.h +0 -90
  263. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +0 -29
  264. data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +0 -37
  265. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +0 -440
  266. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -19
  267. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -69
  268. data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +0 -158
  269. data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +0 -17
  270. data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +0 -424
  271. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -73
  272. data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +0 -13
  273. data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +0 -121
  274. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
  275. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
  276. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +0 -36
  277. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
  278. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +0 -153
  279. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
  280. data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +0 -74
  281. data/vendor/Pods/Headers/YapDatabase/YapNull.h +0 -17
  282. data/vendor/Pods/Headers/YapDatabase/YapTouch.h +0 -15
  283. data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +0 -17
  284. data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +0 -5
  285. data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +0 -5
  286. data/vendor/Pods/Pods-AFNetworking-dummy.m +0 -5
  287. data/vendor/Pods/Pods-AFNetworking-prefix.pch +0 -17
  288. data/vendor/Pods/Pods-AFNetworking.xcconfig +0 -1
  289. data/vendor/Pods/Pods-Reachability-Private.xcconfig +0 -5
  290. data/vendor/Pods/Pods-Reachability-dummy.m +0 -5
  291. data/vendor/Pods/Pods-Reachability-prefix.pch +0 -5
  292. data/vendor/Pods/Pods-Reachability.xcconfig +0 -1
  293. data/vendor/Pods/Reachability/LICENCE.txt +0 -24
  294. data/vendor/Pods/Reachability/README.md +0 -65
  295. data/vendor/Pods/Reachability/Reachability.h +0 -109
  296. data/vendor/Pods/Reachability/Reachability.m +0 -527
@@ -6,10 +6,10 @@
6
6
  * Welcome to Cocoa Lumberjack!
7
7
  *
8
8
  * The project page has a wealth of documentation if you have any questions.
9
- * https://github.com/robbiehanson/CocoaLumberjack
9
+ * https://github.com/CocoaLumberjack/CocoaLumberjack
10
10
  *
11
11
  * If you're new to the project you may wish to read the "Getting Started" wiki.
12
- * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
12
+ * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
13
13
  *
14
14
  *
15
15
  * This class provides an abstract implementation of a database logger.
@@ -21,18 +21,18 @@
21
21
 
22
22
  @interface DDAbstractDatabaseLogger : DDAbstractLogger {
23
23
  @protected
24
- NSUInteger saveThreshold;
25
- NSTimeInterval saveInterval;
26
- NSTimeInterval maxAge;
27
- NSTimeInterval deleteInterval;
28
- BOOL deleteOnEverySave;
29
-
30
- BOOL saveTimerSuspended;
31
- NSUInteger unsavedCount;
32
- dispatch_time_t unsavedTime;
33
- dispatch_source_t saveTimer;
34
- dispatch_time_t lastDeleteTime;
35
- dispatch_source_t deleteTimer;
24
+ NSUInteger saveThreshold;
25
+ NSTimeInterval saveInterval;
26
+ NSTimeInterval maxAge;
27
+ NSTimeInterval deleteInterval;
28
+ BOOL deleteOnEverySave;
29
+
30
+ BOOL saveTimerSuspended;
31
+ NSUInteger unsavedCount;
32
+ dispatch_time_t unsavedTime;
33
+ dispatch_source_t saveTimer;
34
+ dispatch_time_t lastDeleteTime;
35
+ dispatch_source_t deleteTimer;
36
36
  }
37
37
 
38
38
  /**
@@ -5,10 +5,10 @@
5
5
  * Welcome to Cocoa Lumberjack!
6
6
  *
7
7
  * The project page has a wealth of documentation if you have any questions.
8
- * https://github.com/robbiehanson/CocoaLumberjack
8
+ * https://github.com/CocoaLumberjack/CocoaLumberjack
9
9
  *
10
10
  * If you're new to the project you may wish to read the "Getting Started" wiki.
11
- * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
11
+ * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
12
12
  **/
13
13
 
14
14
  #if ! __has_feature(objc_arc)
@@ -26,21 +26,21 @@
26
26
 
27
27
  - (id)init
28
28
  {
29
- if ((self = [super init]))
30
- {
29
+ if ((self = [super init]))
30
+ {
31
31
  saveThreshold = 500;
32
- saveInterval = 60; // 60 seconds
33
- maxAge = (60 * 60 * 24 * 7); // 7 days
34
- deleteInterval = (60 * 5); // 5 minutes
35
- }
36
- return self;
32
+ saveInterval = 60; // 60 seconds
33
+ maxAge = (60 * 60 * 24 * 7); // 7 days
34
+ deleteInterval = (60 * 5); // 5 minutes
35
+ }
36
+ return self;
37
37
  }
38
38
 
39
39
  - (void)dealloc
40
40
  {
41
- [self destroySaveTimer];
42
- [self destroyDeleteTimer];
43
-
41
+ [self destroySaveTimer];
42
+ [self destroyDeleteTimer];
43
+
44
44
  }
45
45
 
46
46
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -49,27 +49,27 @@
49
49
 
50
50
  - (BOOL)db_log:(DDLogMessage *)logMessage
51
51
  {
52
- // Override me and add your implementation.
53
- //
54
- // Return YES if an item was added to the buffer.
55
- // Return NO if the logMessage was ignored.
56
-
57
- return NO;
52
+ // Override me and add your implementation.
53
+ //
54
+ // Return YES if an item was added to the buffer.
55
+ // Return NO if the logMessage was ignored.
56
+
57
+ return NO;
58
58
  }
59
59
 
60
60
  - (void)db_save
61
61
  {
62
- // Override me and add your implementation.
62
+ // Override me and add your implementation.
63
63
  }
64
64
 
65
65
  - (void)db_delete
66
66
  {
67
- // Override me and add your implementation.
67
+ // Override me and add your implementation.
68
68
  }
69
69
 
70
70
  - (void)db_saveAndDelete
71
71
  {
72
- // Override me and add your implementation.
72
+ // Override me and add your implementation.
73
73
  }
74
74
 
75
75
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -78,32 +78,32 @@
78
78
 
79
79
  - (void)performSaveAndSuspendSaveTimer
80
80
  {
81
- if (unsavedCount > 0)
82
- {
83
- if (deleteOnEverySave)
84
- [self db_saveAndDelete];
85
- else
86
- [self db_save];
87
- }
88
-
89
- unsavedCount = 0;
90
- unsavedTime = 0;
91
-
92
- if (saveTimer && !saveTimerSuspended)
93
- {
94
- dispatch_suspend(saveTimer);
95
- saveTimerSuspended = YES;
96
- }
81
+ if (unsavedCount > 0)
82
+ {
83
+ if (deleteOnEverySave)
84
+ [self db_saveAndDelete];
85
+ else
86
+ [self db_save];
87
+ }
88
+
89
+ unsavedCount = 0;
90
+ unsavedTime = 0;
91
+
92
+ if (saveTimer && !saveTimerSuspended)
93
+ {
94
+ dispatch_suspend(saveTimer);
95
+ saveTimerSuspended = YES;
96
+ }
97
97
  }
98
98
 
99
99
  - (void)performDelete
100
100
  {
101
- if (maxAge > 0.0)
102
- {
103
- [self db_delete];
104
-
105
- lastDeleteTime = dispatch_time(DISPATCH_TIME_NOW, 0);
106
- }
101
+ if (maxAge > 0.0)
102
+ {
103
+ [self db_delete];
104
+
105
+ lastDeleteTime = dispatch_time(DISPATCH_TIME_NOW, 0);
106
+ }
107
107
  }
108
108
 
109
109
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -112,88 +112,88 @@
112
112
 
113
113
  - (void)destroySaveTimer
114
114
  {
115
- if (saveTimer)
116
- {
117
- dispatch_source_cancel(saveTimer);
118
- if (saveTimerSuspended)
119
- {
120
- // Must resume a timer before releasing it (or it will crash)
121
- dispatch_resume(saveTimer);
122
- saveTimerSuspended = NO;
123
- }
124
- #if !OS_OBJECT_USE_OBJC
125
- dispatch_release(saveTimer);
126
- #endif
127
- saveTimer = NULL;
128
- }
115
+ if (saveTimer)
116
+ {
117
+ dispatch_source_cancel(saveTimer);
118
+ if (saveTimerSuspended)
119
+ {
120
+ // Must resume a timer before releasing it (or it will crash)
121
+ dispatch_resume(saveTimer);
122
+ saveTimerSuspended = NO;
123
+ }
124
+ #if !OS_OBJECT_USE_OBJC
125
+ dispatch_release(saveTimer);
126
+ #endif
127
+ saveTimer = NULL;
128
+ }
129
129
  }
130
130
 
131
131
  - (void)updateAndResumeSaveTimer
132
132
  {
133
- if ((saveTimer != NULL) && (saveInterval > 0.0) && (unsavedTime > 0.0))
134
- {
135
- uint64_t interval = (uint64_t)(saveInterval * NSEC_PER_SEC);
136
- dispatch_time_t startTime = dispatch_time(unsavedTime, interval);
137
-
138
- dispatch_source_set_timer(saveTimer, startTime, interval, 1.0);
139
-
140
- if (saveTimerSuspended)
141
- {
142
- dispatch_resume(saveTimer);
143
- saveTimerSuspended = NO;
144
- }
145
- }
133
+ if ((saveTimer != NULL) && (saveInterval > 0.0) && (unsavedTime > 0.0))
134
+ {
135
+ uint64_t interval = (uint64_t)(saveInterval * NSEC_PER_SEC);
136
+ dispatch_time_t startTime = dispatch_time(unsavedTime, interval);
137
+
138
+ dispatch_source_set_timer(saveTimer, startTime, interval, 1.0);
139
+
140
+ if (saveTimerSuspended)
141
+ {
142
+ dispatch_resume(saveTimer);
143
+ saveTimerSuspended = NO;
144
+ }
145
+ }
146
146
  }
147
147
 
148
148
  - (void)createSuspendedSaveTimer
149
149
  {
150
- if ((saveTimer == NULL) && (saveInterval > 0.0))
151
- {
152
- saveTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
153
-
154
- dispatch_source_set_event_handler(saveTimer, ^{ @autoreleasepool {
155
-
156
- [self performSaveAndSuspendSaveTimer];
157
-
158
- }});
159
-
160
- saveTimerSuspended = YES;
161
- }
150
+ if ((saveTimer == NULL) && (saveInterval > 0.0))
151
+ {
152
+ saveTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
153
+
154
+ dispatch_source_set_event_handler(saveTimer, ^{ @autoreleasepool {
155
+
156
+ [self performSaveAndSuspendSaveTimer];
157
+
158
+ }});
159
+
160
+ saveTimerSuspended = YES;
161
+ }
162
162
  }
163
163
 
164
164
  - (void)destroyDeleteTimer
165
165
  {
166
- if (deleteTimer)
167
- {
168
- dispatch_source_cancel(deleteTimer);
169
- #if !OS_OBJECT_USE_OBJC
170
- dispatch_release(deleteTimer);
171
- #endif
172
- deleteTimer = NULL;
173
- }
166
+ if (deleteTimer)
167
+ {
168
+ dispatch_source_cancel(deleteTimer);
169
+ #if !OS_OBJECT_USE_OBJC
170
+ dispatch_release(deleteTimer);
171
+ #endif
172
+ deleteTimer = NULL;
173
+ }
174
174
  }
175
175
 
176
176
  - (void)updateDeleteTimer
177
177
  {
178
- if ((deleteTimer != NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
179
- {
180
- uint64_t interval = (uint64_t)(deleteInterval * NSEC_PER_SEC);
181
- dispatch_time_t startTime;
182
-
183
- if (lastDeleteTime > 0)
184
- startTime = dispatch_time(lastDeleteTime, interval);
185
- else
186
- startTime = dispatch_time(DISPATCH_TIME_NOW, interval);
187
-
188
- dispatch_source_set_timer(deleteTimer, startTime, interval, 1.0);
189
- }
178
+ if ((deleteTimer != NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
179
+ {
180
+ uint64_t interval = (uint64_t)(deleteInterval * NSEC_PER_SEC);
181
+ dispatch_time_t startTime;
182
+
183
+ if (lastDeleteTime > 0)
184
+ startTime = dispatch_time(lastDeleteTime, interval);
185
+ else
186
+ startTime = dispatch_time(DISPATCH_TIME_NOW, interval);
187
+
188
+ dispatch_source_set_timer(deleteTimer, startTime, interval, 1.0);
189
+ }
190
190
  }
191
191
 
192
192
  - (void)createAndStartDeleteTimer
193
193
  {
194
- if ((deleteTimer == NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
195
- {
196
- deleteTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
194
+ if ((deleteTimer == NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
195
+ {
196
+ deleteTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
197
197
 
198
198
  if (deleteTimer != NULL) {
199
199
  dispatch_source_set_event_handler(deleteTimer, ^{ @autoreleasepool {
@@ -204,9 +204,9 @@
204
204
 
205
205
  [self updateDeleteTimer];
206
206
 
207
- dispatch_resume(deleteTimer);
207
+ if (deleteTimer != NULL) dispatch_resume(deleteTimer);
208
208
  }
209
- }
209
+ }
210
210
  }
211
211
 
212
212
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -215,432 +215,432 @@
215
215
 
216
216
  - (NSUInteger)saveThreshold
217
217
  {
218
- // The design of this method is taken from the DDAbstractLogger implementation.
219
- // For extensive documentation please refer to the DDAbstractLogger implementation.
220
-
221
- // Note: The internal implementation MUST access the colorsEnabled variable directly,
222
- // This method is designed explicitly for external access.
223
- //
224
- // Using "self." syntax to go through this method will cause immediate deadlock.
225
- // This is the intended result. Fix it by accessing the ivar directly.
226
- // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
227
-
228
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
229
- NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
230
-
231
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
232
-
233
- __block NSUInteger result;
234
-
235
- dispatch_sync(globalLoggingQueue, ^{
236
- dispatch_sync(loggerQueue, ^{
237
- result = saveThreshold;
238
- });
239
- });
240
-
241
- return result;
218
+ // The design of this method is taken from the DDAbstractLogger implementation.
219
+ // For extensive documentation please refer to the DDAbstractLogger implementation.
220
+
221
+ // Note: The internal implementation MUST access the colorsEnabled variable directly,
222
+ // This method is designed explicitly for external access.
223
+ //
224
+ // Using "self." syntax to go through this method will cause immediate deadlock.
225
+ // This is the intended result. Fix it by accessing the ivar directly.
226
+ // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
227
+
228
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
229
+ NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
230
+
231
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
232
+
233
+ __block NSUInteger result;
234
+
235
+ dispatch_sync(globalLoggingQueue, ^{
236
+ dispatch_sync(loggerQueue, ^{
237
+ result = saveThreshold;
238
+ });
239
+ });
240
+
241
+ return result;
242
242
  }
243
243
 
244
244
  - (void)setSaveThreshold:(NSUInteger)threshold
245
245
  {
246
- dispatch_block_t block = ^{ @autoreleasepool {
247
-
248
- if (saveThreshold != threshold)
249
- {
250
- saveThreshold = threshold;
251
-
252
- // Since the saveThreshold has changed,
253
- // we check to see if the current unsavedCount has surpassed the new threshold.
254
- //
255
- // If it has, we immediately save the log.
256
-
257
- if ((unsavedCount >= saveThreshold) && (saveThreshold > 0))
258
- {
259
- [self performSaveAndSuspendSaveTimer];
260
- }
261
- }
262
- }};
263
-
264
- // The design of the setter logic below is taken from the DDAbstractLogger implementation.
265
- // For documentation please refer to the DDAbstractLogger implementation.
266
-
267
- if ([self isOnInternalLoggerQueue])
268
- {
269
- block();
270
- }
271
- else
272
- {
273
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
274
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
275
-
276
- dispatch_async(globalLoggingQueue, ^{
277
- dispatch_async(loggerQueue, block);
278
- });
279
- }
246
+ dispatch_block_t block = ^{ @autoreleasepool {
247
+
248
+ if (saveThreshold != threshold)
249
+ {
250
+ saveThreshold = threshold;
251
+
252
+ // Since the saveThreshold has changed,
253
+ // we check to see if the current unsavedCount has surpassed the new threshold.
254
+ //
255
+ // If it has, we immediately save the log.
256
+
257
+ if ((unsavedCount >= saveThreshold) && (saveThreshold > 0))
258
+ {
259
+ [self performSaveAndSuspendSaveTimer];
260
+ }
261
+ }
262
+ }};
263
+
264
+ // The design of the setter logic below is taken from the DDAbstractLogger implementation.
265
+ // For documentation please refer to the DDAbstractLogger implementation.
266
+
267
+ if ([self isOnInternalLoggerQueue])
268
+ {
269
+ block();
270
+ }
271
+ else
272
+ {
273
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
274
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
275
+
276
+ dispatch_async(globalLoggingQueue, ^{
277
+ dispatch_async(loggerQueue, block);
278
+ });
279
+ }
280
280
  }
281
281
 
282
282
  - (NSTimeInterval)saveInterval
283
283
  {
284
- // The design of this method is taken from the DDAbstractLogger implementation.
285
- // For extensive documentation please refer to the DDAbstractLogger implementation.
286
-
287
- // Note: The internal implementation MUST access the colorsEnabled variable directly,
288
- // This method is designed explicitly for external access.
289
- //
290
- // Using "self." syntax to go through this method will cause immediate deadlock.
291
- // This is the intended result. Fix it by accessing the ivar directly.
292
- // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
293
-
294
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
295
- NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
296
-
297
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
298
-
299
- __block NSTimeInterval result;
300
-
301
- dispatch_sync(globalLoggingQueue, ^{
302
- dispatch_sync(loggerQueue, ^{
303
- result = saveInterval;
304
- });
305
- });
306
-
307
- return result;
284
+ // The design of this method is taken from the DDAbstractLogger implementation.
285
+ // For extensive documentation please refer to the DDAbstractLogger implementation.
286
+
287
+ // Note: The internal implementation MUST access the colorsEnabled variable directly,
288
+ // This method is designed explicitly for external access.
289
+ //
290
+ // Using "self." syntax to go through this method will cause immediate deadlock.
291
+ // This is the intended result. Fix it by accessing the ivar directly.
292
+ // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
293
+
294
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
295
+ NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
296
+
297
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
298
+
299
+ __block NSTimeInterval result;
300
+
301
+ dispatch_sync(globalLoggingQueue, ^{
302
+ dispatch_sync(loggerQueue, ^{
303
+ result = saveInterval;
304
+ });
305
+ });
306
+
307
+ return result;
308
308
  }
309
309
 
310
310
  - (void)setSaveInterval:(NSTimeInterval)interval
311
311
  {
312
- dispatch_block_t block = ^{ @autoreleasepool {
313
-
314
- // C99 recommended floating point comparison macro
315
- // Read: isLessThanOrGreaterThan(floatA, floatB)
316
-
317
- if (/* saveInterval != interval */ islessgreater(saveInterval, interval))
318
- {
319
- saveInterval = interval;
320
-
321
- // There are several cases we need to handle here.
322
- //
323
- // 1. If the saveInterval was previously enabled and it just got disabled,
324
- // then we need to stop the saveTimer. (And we might as well release it.)
325
- //
326
- // 2. If the saveInterval was previously disabled and it just got enabled,
327
- // then we need to setup the saveTimer. (Plus we might need to do an immediate save.)
328
- //
329
- // 3. If the saveInterval increased, then we need to reset the timer so that it fires at the later date.
330
- //
331
- // 4. If the saveInterval decreased, then we need to reset the timer so that it fires at an earlier date.
332
- // (Plus we might need to do an immediate save.)
333
-
334
- if (saveInterval > 0.0)
335
- {
336
- if (saveTimer == NULL)
337
- {
338
- // Handles #2
339
- //
340
- // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
341
- // if a save is needed the timer will fire immediately.
342
-
343
- [self createSuspendedSaveTimer];
344
- [self updateAndResumeSaveTimer];
345
- }
346
- else
347
- {
348
- // Handles #3
349
- // Handles #4
350
- //
351
- // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
352
- // if a save is needed the timer will fire immediately.
353
-
354
- [self updateAndResumeSaveTimer];
355
- }
356
- }
357
- else if (saveTimer)
358
- {
359
- // Handles #1
360
-
361
- [self destroySaveTimer];
362
- }
363
- }
364
- }};
365
-
366
- // The design of the setter logic below is taken from the DDAbstractLogger implementation.
367
- // For documentation please refer to the DDAbstractLogger implementation.
368
-
369
- if ([self isOnInternalLoggerQueue])
370
- {
371
- block();
372
- }
373
- else
374
- {
375
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
376
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
377
-
378
- dispatch_async(globalLoggingQueue, ^{
379
- dispatch_async(loggerQueue, block);
380
- });
381
- }
312
+ dispatch_block_t block = ^{ @autoreleasepool {
313
+
314
+ // C99 recommended floating point comparison macro
315
+ // Read: isLessThanOrGreaterThan(floatA, floatB)
316
+
317
+ if (/* saveInterval != interval */ islessgreater(saveInterval, interval))
318
+ {
319
+ saveInterval = interval;
320
+
321
+ // There are several cases we need to handle here.
322
+ //
323
+ // 1. If the saveInterval was previously enabled and it just got disabled,
324
+ // then we need to stop the saveTimer. (And we might as well release it.)
325
+ //
326
+ // 2. If the saveInterval was previously disabled and it just got enabled,
327
+ // then we need to setup the saveTimer. (Plus we might need to do an immediate save.)
328
+ //
329
+ // 3. If the saveInterval increased, then we need to reset the timer so that it fires at the later date.
330
+ //
331
+ // 4. If the saveInterval decreased, then we need to reset the timer so that it fires at an earlier date.
332
+ // (Plus we might need to do an immediate save.)
333
+
334
+ if (saveInterval > 0.0)
335
+ {
336
+ if (saveTimer == NULL)
337
+ {
338
+ // Handles #2
339
+ //
340
+ // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
341
+ // if a save is needed the timer will fire immediately.
342
+
343
+ [self createSuspendedSaveTimer];
344
+ [self updateAndResumeSaveTimer];
345
+ }
346
+ else
347
+ {
348
+ // Handles #3
349
+ // Handles #4
350
+ //
351
+ // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
352
+ // if a save is needed the timer will fire immediately.
353
+
354
+ [self updateAndResumeSaveTimer];
355
+ }
356
+ }
357
+ else if (saveTimer)
358
+ {
359
+ // Handles #1
360
+
361
+ [self destroySaveTimer];
362
+ }
363
+ }
364
+ }};
365
+
366
+ // The design of the setter logic below is taken from the DDAbstractLogger implementation.
367
+ // For documentation please refer to the DDAbstractLogger implementation.
368
+
369
+ if ([self isOnInternalLoggerQueue])
370
+ {
371
+ block();
372
+ }
373
+ else
374
+ {
375
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
376
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
377
+
378
+ dispatch_async(globalLoggingQueue, ^{
379
+ dispatch_async(loggerQueue, block);
380
+ });
381
+ }
382
382
  }
383
383
 
384
384
  - (NSTimeInterval)maxAge
385
385
  {
386
- // The design of this method is taken from the DDAbstractLogger implementation.
387
- // For extensive documentation please refer to the DDAbstractLogger implementation.
388
-
389
- // Note: The internal implementation MUST access the colorsEnabled variable directly,
390
- // This method is designed explicitly for external access.
391
- //
392
- // Using "self." syntax to go through this method will cause immediate deadlock.
393
- // This is the intended result. Fix it by accessing the ivar directly.
394
- // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
395
-
396
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
397
- NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
398
-
399
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
400
-
401
- __block NSTimeInterval result;
402
-
403
- dispatch_sync(globalLoggingQueue, ^{
404
- dispatch_sync(loggerQueue, ^{
405
- result = maxAge;
406
- });
407
- });
408
-
409
- return result;
386
+ // The design of this method is taken from the DDAbstractLogger implementation.
387
+ // For extensive documentation please refer to the DDAbstractLogger implementation.
388
+
389
+ // Note: The internal implementation MUST access the colorsEnabled variable directly,
390
+ // This method is designed explicitly for external access.
391
+ //
392
+ // Using "self." syntax to go through this method will cause immediate deadlock.
393
+ // This is the intended result. Fix it by accessing the ivar directly.
394
+ // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
395
+
396
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
397
+ NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
398
+
399
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
400
+
401
+ __block NSTimeInterval result;
402
+
403
+ dispatch_sync(globalLoggingQueue, ^{
404
+ dispatch_sync(loggerQueue, ^{
405
+ result = maxAge;
406
+ });
407
+ });
408
+
409
+ return result;
410
410
  }
411
411
 
412
412
  - (void)setMaxAge:(NSTimeInterval)interval
413
413
  {
414
- dispatch_block_t block = ^{ @autoreleasepool {
415
-
416
- // C99 recommended floating point comparison macro
417
- // Read: isLessThanOrGreaterThan(floatA, floatB)
418
-
419
- if (/* maxAge != interval */ islessgreater(maxAge, interval))
420
- {
421
- NSTimeInterval oldMaxAge = maxAge;
422
- NSTimeInterval newMaxAge = interval;
423
-
424
- maxAge = interval;
425
-
426
- // There are several cases we need to handle here.
427
- //
428
- // 1. If the maxAge was previously enabled and it just got disabled,
429
- // then we need to stop the deleteTimer. (And we might as well release it.)
430
- //
431
- // 2. If the maxAge was previously disabled and it just got enabled,
432
- // then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.)
433
- //
434
- // 3. If the maxAge was increased,
435
- // then we don't need to do anything.
436
- //
437
- // 4. If the maxAge was decreased,
438
- // then we should do an immediate delete.
439
-
440
- BOOL shouldDeleteNow = NO;
441
-
442
- if (oldMaxAge > 0.0)
443
- {
444
- if (newMaxAge <= 0.0)
445
- {
446
- // Handles #1
447
-
448
- [self destroyDeleteTimer];
449
- }
450
- else if (oldMaxAge > newMaxAge)
451
- {
452
- // Handles #4
453
- shouldDeleteNow = YES;
454
- }
455
- }
456
- else if (newMaxAge > 0.0)
457
- {
458
- // Handles #2
459
- shouldDeleteNow = YES;
460
- }
461
-
462
- if (shouldDeleteNow)
463
- {
464
- [self performDelete];
465
-
466
- if (deleteTimer)
467
- [self updateDeleteTimer];
468
- else
469
- [self createAndStartDeleteTimer];
470
- }
471
- }
472
- }};
473
-
474
- // The design of the setter logic below is taken from the DDAbstractLogger implementation.
475
- // For documentation please refer to the DDAbstractLogger implementation.
476
-
477
- if ([self isOnInternalLoggerQueue])
478
- {
479
- block();
480
- }
481
- else
482
- {
483
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
484
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
485
-
486
- dispatch_async(globalLoggingQueue, ^{
487
- dispatch_async(loggerQueue, block);
488
- });
489
- }
414
+ dispatch_block_t block = ^{ @autoreleasepool {
415
+
416
+ // C99 recommended floating point comparison macro
417
+ // Read: isLessThanOrGreaterThan(floatA, floatB)
418
+
419
+ if (/* maxAge != interval */ islessgreater(maxAge, interval))
420
+ {
421
+ NSTimeInterval oldMaxAge = maxAge;
422
+ NSTimeInterval newMaxAge = interval;
423
+
424
+ maxAge = interval;
425
+
426
+ // There are several cases we need to handle here.
427
+ //
428
+ // 1. If the maxAge was previously enabled and it just got disabled,
429
+ // then we need to stop the deleteTimer. (And we might as well release it.)
430
+ //
431
+ // 2. If the maxAge was previously disabled and it just got enabled,
432
+ // then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.)
433
+ //
434
+ // 3. If the maxAge was increased,
435
+ // then we don't need to do anything.
436
+ //
437
+ // 4. If the maxAge was decreased,
438
+ // then we should do an immediate delete.
439
+
440
+ BOOL shouldDeleteNow = NO;
441
+
442
+ if (oldMaxAge > 0.0)
443
+ {
444
+ if (newMaxAge <= 0.0)
445
+ {
446
+ // Handles #1
447
+
448
+ [self destroyDeleteTimer];
449
+ }
450
+ else if (oldMaxAge > newMaxAge)
451
+ {
452
+ // Handles #4
453
+ shouldDeleteNow = YES;
454
+ }
455
+ }
456
+ else if (newMaxAge > 0.0)
457
+ {
458
+ // Handles #2
459
+ shouldDeleteNow = YES;
460
+ }
461
+
462
+ if (shouldDeleteNow)
463
+ {
464
+ [self performDelete];
465
+
466
+ if (deleteTimer)
467
+ [self updateDeleteTimer];
468
+ else
469
+ [self createAndStartDeleteTimer];
470
+ }
471
+ }
472
+ }};
473
+
474
+ // The design of the setter logic below is taken from the DDAbstractLogger implementation.
475
+ // For documentation please refer to the DDAbstractLogger implementation.
476
+
477
+ if ([self isOnInternalLoggerQueue])
478
+ {
479
+ block();
480
+ }
481
+ else
482
+ {
483
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
484
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
485
+
486
+ dispatch_async(globalLoggingQueue, ^{
487
+ dispatch_async(loggerQueue, block);
488
+ });
489
+ }
490
490
  }
491
491
 
492
492
  - (NSTimeInterval)deleteInterval
493
493
  {
494
- // The design of this method is taken from the DDAbstractLogger implementation.
495
- // For extensive documentation please refer to the DDAbstractLogger implementation.
496
-
497
- // Note: The internal implementation MUST access the colorsEnabled variable directly,
498
- // This method is designed explicitly for external access.
499
- //
500
- // Using "self." syntax to go through this method will cause immediate deadlock.
501
- // This is the intended result. Fix it by accessing the ivar directly.
502
- // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
503
-
504
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
505
- NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
506
-
507
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
508
-
509
- __block NSTimeInterval result;
510
-
511
- dispatch_sync(globalLoggingQueue, ^{
512
- dispatch_sync(loggerQueue, ^{
513
- result = deleteInterval;
514
- });
515
- });
516
-
517
- return result;
494
+ // The design of this method is taken from the DDAbstractLogger implementation.
495
+ // For extensive documentation please refer to the DDAbstractLogger implementation.
496
+
497
+ // Note: The internal implementation MUST access the colorsEnabled variable directly,
498
+ // This method is designed explicitly for external access.
499
+ //
500
+ // Using "self." syntax to go through this method will cause immediate deadlock.
501
+ // This is the intended result. Fix it by accessing the ivar directly.
502
+ // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
503
+
504
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
505
+ NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
506
+
507
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
508
+
509
+ __block NSTimeInterval result;
510
+
511
+ dispatch_sync(globalLoggingQueue, ^{
512
+ dispatch_sync(loggerQueue, ^{
513
+ result = deleteInterval;
514
+ });
515
+ });
516
+
517
+ return result;
518
518
  }
519
519
 
520
520
  - (void)setDeleteInterval:(NSTimeInterval)interval
521
521
  {
522
- dispatch_block_t block = ^{ @autoreleasepool {
523
-
524
- // C99 recommended floating point comparison macro
525
- // Read: isLessThanOrGreaterThan(floatA, floatB)
526
-
527
- if (/* deleteInterval != interval */ islessgreater(deleteInterval, interval))
528
- {
529
- deleteInterval = interval;
530
-
531
- // There are several cases we need to handle here.
532
- //
533
- // 1. If the deleteInterval was previously enabled and it just got disabled,
534
- // then we need to stop the deleteTimer. (And we might as well release it.)
535
- //
536
- // 2. If the deleteInterval was previously disabled and it just got enabled,
537
- // then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.)
538
- //
539
- // 3. If the deleteInterval increased, then we need to reset the timer so that it fires at the later date.
540
- //
541
- // 4. If the deleteInterval decreased, then we need to reset the timer so that it fires at an earlier date.
542
- // (Plus we might need to do an immediate delete.)
543
-
544
- if (deleteInterval > 0.0)
545
- {
546
- if (deleteTimer == NULL)
547
- {
548
- // Handles #2
549
- //
550
- // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
551
- // if a delete is needed the timer will fire immediately.
552
-
553
- [self createAndStartDeleteTimer];
554
- }
555
- else
556
- {
557
- // Handles #3
558
- // Handles #4
559
- //
560
- // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
561
- // if a save is needed the timer will fire immediately.
562
-
563
- [self updateDeleteTimer];
564
- }
565
- }
566
- else if (deleteTimer)
567
- {
568
- // Handles #1
569
-
570
- [self destroyDeleteTimer];
571
- }
572
- }
573
- }};
574
-
575
- // The design of the setter logic below is taken from the DDAbstractLogger implementation.
576
- // For documentation please refer to the DDAbstractLogger implementation.
577
-
578
- if ([self isOnInternalLoggerQueue])
579
- {
580
- block();
581
- }
582
- else
583
- {
584
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
585
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
586
-
587
- dispatch_async(globalLoggingQueue, ^{
588
- dispatch_async(loggerQueue, block);
589
- });
590
- }
522
+ dispatch_block_t block = ^{ @autoreleasepool {
523
+
524
+ // C99 recommended floating point comparison macro
525
+ // Read: isLessThanOrGreaterThan(floatA, floatB)
526
+
527
+ if (/* deleteInterval != interval */ islessgreater(deleteInterval, interval))
528
+ {
529
+ deleteInterval = interval;
530
+
531
+ // There are several cases we need to handle here.
532
+ //
533
+ // 1. If the deleteInterval was previously enabled and it just got disabled,
534
+ // then we need to stop the deleteTimer. (And we might as well release it.)
535
+ //
536
+ // 2. If the deleteInterval was previously disabled and it just got enabled,
537
+ // then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.)
538
+ //
539
+ // 3. If the deleteInterval increased, then we need to reset the timer so that it fires at the later date.
540
+ //
541
+ // 4. If the deleteInterval decreased, then we need to reset the timer so that it fires at an earlier date.
542
+ // (Plus we might need to do an immediate delete.)
543
+
544
+ if (deleteInterval > 0.0)
545
+ {
546
+ if (deleteTimer == NULL)
547
+ {
548
+ // Handles #2
549
+ //
550
+ // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
551
+ // if a delete is needed the timer will fire immediately.
552
+
553
+ [self createAndStartDeleteTimer];
554
+ }
555
+ else
556
+ {
557
+ // Handles #3
558
+ // Handles #4
559
+ //
560
+ // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
561
+ // if a save is needed the timer will fire immediately.
562
+
563
+ [self updateDeleteTimer];
564
+ }
565
+ }
566
+ else if (deleteTimer)
567
+ {
568
+ // Handles #1
569
+
570
+ [self destroyDeleteTimer];
571
+ }
572
+ }
573
+ }};
574
+
575
+ // The design of the setter logic below is taken from the DDAbstractLogger implementation.
576
+ // For documentation please refer to the DDAbstractLogger implementation.
577
+
578
+ if ([self isOnInternalLoggerQueue])
579
+ {
580
+ block();
581
+ }
582
+ else
583
+ {
584
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
585
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
586
+
587
+ dispatch_async(globalLoggingQueue, ^{
588
+ dispatch_async(loggerQueue, block);
589
+ });
590
+ }
591
591
  }
592
592
 
593
593
  - (BOOL)deleteOnEverySave
594
594
  {
595
- // The design of this method is taken from the DDAbstractLogger implementation.
596
- // For extensive documentation please refer to the DDAbstractLogger implementation.
597
-
598
- // Note: The internal implementation MUST access the colorsEnabled variable directly,
599
- // This method is designed explicitly for external access.
600
- //
601
- // Using "self." syntax to go through this method will cause immediate deadlock.
602
- // This is the intended result. Fix it by accessing the ivar directly.
603
- // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
604
-
605
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
606
- NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
607
-
608
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
609
-
610
- __block BOOL result;
611
-
612
- dispatch_sync(globalLoggingQueue, ^{
613
- dispatch_sync(loggerQueue, ^{
614
- result = deleteOnEverySave;
615
- });
616
- });
617
-
618
- return result;
595
+ // The design of this method is taken from the DDAbstractLogger implementation.
596
+ // For extensive documentation please refer to the DDAbstractLogger implementation.
597
+
598
+ // Note: The internal implementation MUST access the colorsEnabled variable directly,
599
+ // This method is designed explicitly for external access.
600
+ //
601
+ // Using "self." syntax to go through this method will cause immediate deadlock.
602
+ // This is the intended result. Fix it by accessing the ivar directly.
603
+ // Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
604
+
605
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
606
+ NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
607
+
608
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
609
+
610
+ __block BOOL result;
611
+
612
+ dispatch_sync(globalLoggingQueue, ^{
613
+ dispatch_sync(loggerQueue, ^{
614
+ result = deleteOnEverySave;
615
+ });
616
+ });
617
+
618
+ return result;
619
619
  }
620
620
 
621
621
  - (void)setDeleteOnEverySave:(BOOL)flag
622
622
  {
623
- dispatch_block_t block = ^{
624
-
625
- deleteOnEverySave = flag;
626
- };
627
-
628
- // The design of the setter logic below is taken from the DDAbstractLogger implementation.
629
- // For documentation please refer to the DDAbstractLogger implementation.
630
-
631
- if ([self isOnInternalLoggerQueue])
632
- {
633
- block();
634
- }
635
- else
636
- {
637
- dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
638
- NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
639
-
640
- dispatch_async(globalLoggingQueue, ^{
641
- dispatch_async(loggerQueue, block);
642
- });
643
- }
623
+ dispatch_block_t block = ^{
624
+
625
+ deleteOnEverySave = flag;
626
+ };
627
+
628
+ // The design of the setter logic below is taken from the DDAbstractLogger implementation.
629
+ // For documentation please refer to the DDAbstractLogger implementation.
630
+
631
+ if ([self isOnInternalLoggerQueue])
632
+ {
633
+ block();
634
+ }
635
+ else
636
+ {
637
+ dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
638
+ NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
639
+
640
+ dispatch_async(globalLoggingQueue, ^{
641
+ dispatch_async(loggerQueue, block);
642
+ });
643
+ }
644
644
  }
645
645
 
646
646
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -649,28 +649,28 @@
649
649
 
650
650
  - (void)savePendingLogEntries
651
651
  {
652
- dispatch_block_t block = ^{ @autoreleasepool {
653
-
654
- [self performSaveAndSuspendSaveTimer];
655
- }};
656
-
657
- if ([self isOnInternalLoggerQueue])
658
- block();
659
- else
660
- dispatch_async(loggerQueue, block);
652
+ dispatch_block_t block = ^{ @autoreleasepool {
653
+
654
+ [self performSaveAndSuspendSaveTimer];
655
+ }};
656
+
657
+ if ([self isOnInternalLoggerQueue])
658
+ block();
659
+ else
660
+ dispatch_async(loggerQueue, block);
661
661
  }
662
662
 
663
663
  - (void)deleteOldLogEntries
664
664
  {
665
- dispatch_block_t block = ^{ @autoreleasepool {
666
-
667
- [self performDelete];
668
- }};
669
-
670
- if ([self isOnInternalLoggerQueue])
671
- block();
672
- else
673
- dispatch_async(loggerQueue, block);
665
+ dispatch_block_t block = ^{ @autoreleasepool {
666
+
667
+ [self performDelete];
668
+ }};
669
+
670
+ if ([self isOnInternalLoggerQueue])
671
+ block();
672
+ else
673
+ dispatch_async(loggerQueue, block);
674
674
  }
675
675
 
676
676
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -679,49 +679,49 @@
679
679
 
680
680
  - (void)didAddLogger
681
681
  {
682
- // If you override me be sure to invoke [super didAddLogger];
683
-
684
- [self createSuspendedSaveTimer];
685
-
686
- [self createAndStartDeleteTimer];
682
+ // If you override me be sure to invoke [super didAddLogger];
683
+
684
+ [self createSuspendedSaveTimer];
685
+
686
+ [self createAndStartDeleteTimer];
687
687
  }
688
688
 
689
689
  - (void)willRemoveLogger
690
690
  {
691
- // If you override me be sure to invoke [super willRemoveLogger];
692
-
693
- [self performSaveAndSuspendSaveTimer];
694
-
695
- [self destroySaveTimer];
696
- [self destroyDeleteTimer];
691
+ // If you override me be sure to invoke [super willRemoveLogger];
692
+
693
+ [self performSaveAndSuspendSaveTimer];
694
+
695
+ [self destroySaveTimer];
696
+ [self destroyDeleteTimer];
697
697
  }
698
698
 
699
699
  - (void)logMessage:(DDLogMessage *)logMessage
700
700
  {
701
- if ([self db_log:logMessage])
702
- {
703
- BOOL firstUnsavedEntry = (++unsavedCount == 1);
704
-
705
- if ((unsavedCount >= saveThreshold) && (saveThreshold > 0))
706
- {
707
- [self performSaveAndSuspendSaveTimer];
708
- }
709
- else if (firstUnsavedEntry)
710
- {
711
- unsavedTime = dispatch_time(DISPATCH_TIME_NOW, 0);
712
- [self updateAndResumeSaveTimer];
713
- }
714
- }
701
+ if ([self db_log:logMessage])
702
+ {
703
+ BOOL firstUnsavedEntry = (++unsavedCount == 1);
704
+
705
+ if ((unsavedCount >= saveThreshold) && (saveThreshold > 0))
706
+ {
707
+ [self performSaveAndSuspendSaveTimer];
708
+ }
709
+ else if (firstUnsavedEntry)
710
+ {
711
+ unsavedTime = dispatch_time(DISPATCH_TIME_NOW, 0);
712
+ [self updateAndResumeSaveTimer];
713
+ }
714
+ }
715
715
  }
716
716
 
717
717
  - (void)flush
718
718
  {
719
- // This method is invoked by DDLog's flushLog method.
720
- //
721
- // It is called automatically when the application quits,
722
- // or if the developer invokes DDLog's flushLog method prior to crashing or something.
723
-
724
- [self performSaveAndSuspendSaveTimer];
719
+ // This method is invoked by DDLog's flushLog method.
720
+ //
721
+ // It is called automatically when the application quits,
722
+ // or if the developer invokes DDLog's flushLog method prior to crashing or something.
723
+
724
+ [self performSaveAndSuspendSaveTimer];
725
725
  }
726
726
 
727
727
  @end