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.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.travis.yml +2 -0
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/lib/motion-yapper.rb +1 -0
- data/lib/yapper.rb +3 -5
- data/lib/yapper/config.rb +2 -0
- data/lib/yapper/db.rb +105 -40
- data/lib/yapper/document.rb +7 -4
- data/lib/yapper/document/callbacks.rb +0 -7
- data/lib/yapper/document/{persistance.rb → persistence.rb} +27 -21
- data/lib/yapper/document/relation.rb +29 -22
- data/lib/yapper/document/selection.rb +122 -54
- data/lib/yapper/extensions.rb +12 -24
- data/lib/yapper/settings.rb +43 -0
- data/lib/yapper/timestamps.rb +2 -0
- data/lib/yapper/version.rb +1 -1
- data/{yapper.gemspec → motion-yapper.gemspec} +0 -0
- data/spec/integration/{where_spec.rb → criteria_spec.rb} +78 -10
- data/spec/integration/db_spec.rb +70 -0
- data/spec/integration/defaults_spec.rb +37 -0
- data/spec/integration/extensions_spec.rb +14 -0
- data/spec/integration/{persistance_spec.rb → persistence_spec.rb} +0 -0
- data/spec/integration/relation_spec.rb +4 -4
- data/vendor/Podfile.lock +9 -11
- data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
- data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
- data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
- data/vendor/Pods/.build/libPods.a +0 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/{CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h → BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +51 -50
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +546 -546
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1093 -907
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +98 -65
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +873 -748
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1284 -1243
- data/vendor/Pods/{BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h → CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{ContextFilterLogFormatter.m → DDContextFilterLogFormatter.m} +70 -70
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +253 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +30 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +127 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +1 -1
- data/vendor/Pods/CocoaLumberjack/README.markdown +52 -15
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/Headers/CocoaLumberjack/{ContextFilterLogFormatter.h → DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/Headers/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +2 -0
- data/vendor/Pods/Headers/____Pods-environment.h +15 -15
- data/vendor/Pods/Manifest.lock +9 -11
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +2 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +1 -1
- data/vendor/Pods/{Pods-Acknowledgements.markdown → Pods-acknowledgements.markdown} +0 -37
- data/vendor/Pods/{Pods-Acknowledgements.plist → Pods-acknowledgements.plist} +0 -45
- data/vendor/Pods/Pods-environment.h +15 -15
- data/vendor/Pods/Pods.xcconfig +3 -3
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +2426 -3155
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
- data/vendor/Pods/YapDatabase/README.md +3 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +25 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +403 -134
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +8 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +113 -62
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +25 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +25 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +129 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +802 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +408 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +5254 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +9 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +62 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +148 -45
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +15 -9
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +211 -64
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +48 -107
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +10 -7
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +13 -22
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +725 -244
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +19 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +3 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +4 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +3 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +5 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +84 -93
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +381 -209
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +587 -267
- data/vendor/Pods/{Pods.bridgesupport → build-iPhoneSimulator/Pods.bridgesupport} +633 -2557
- data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +4 -2
- metadata +80 -108
- data/Gemfile.lock +0 -63
- data/lib/yapper/attachment.rb +0 -48
- data/lib/yapper/document/attachment.rb +0 -26
- data/lib/yapper/sync.rb +0 -134
- data/lib/yapper/sync/data.rb +0 -12
- data/lib/yapper/sync/event.rb +0 -194
- data/lib/yapper/sync/queue.rb +0 -164
- data/spec/integration/all_spec.rb +0 -40
- data/spec/integration/sync_spec.rb +0 -42
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +0 -1396
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +0 -327
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +0 -321
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +0 -150
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +0 -157
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +0 -143
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +0 -848
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +0 -167
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +0 -191
- data/vendor/Pods/AFNetworking/LICENSE +0 -19
- data/vendor/Pods/AFNetworking/README.md +0 -208
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +0 -109
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +0 -251
- data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/Headers/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Headers/YapDatabase/YapCache.h +0 -90
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +0 -440
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -69
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +0 -424
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -73
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +0 -121
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +0 -153
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +0 -74
- data/vendor/Pods/Headers/YapDatabase/YapNull.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapTouch.h +0 -15
- data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +0 -17
- data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +0 -5
- data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-AFNetworking-dummy.m +0 -5
- data/vendor/Pods/Pods-AFNetworking-prefix.pch +0 -17
- data/vendor/Pods/Pods-AFNetworking.xcconfig +0 -1
- data/vendor/Pods/Pods-Reachability-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-Reachability-dummy.m +0 -5
- data/vendor/Pods/Pods-Reachability-prefix.pch +0 -5
- data/vendor/Pods/Pods-Reachability.xcconfig +0 -1
- data/vendor/Pods/Reachability/LICENCE.txt +0 -24
- data/vendor/Pods/Reachability/README.md +0 -65
- data/vendor/Pods/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Reachability/Reachability.m +0 -527
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
#import <Foundation/Foundation.h>
|
|
2
2
|
#import "DDLog.h"
|
|
3
3
|
|
|
4
|
-
@class ContextFilterLogFormatter;
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Welcome to Cocoa Lumberjack!
|
|
8
6
|
*
|
|
9
7
|
* The project page has a wealth of documentation if you have any questions.
|
|
10
|
-
* https://github.com/
|
|
8
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
11
9
|
*
|
|
12
10
|
* If you're new to the project you may wish to read the "Getting Started" page.
|
|
13
|
-
* https://github.com/
|
|
11
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
14
12
|
*
|
|
15
13
|
*
|
|
16
14
|
* This class provides a log formatter that filters log statements from a logging context not on the whitelist.
|
|
17
15
|
*
|
|
18
16
|
* A log formatter can be added to any logger to format and/or filter its output.
|
|
19
17
|
* You can learn more about log formatters here:
|
|
20
|
-
* https://github.com/
|
|
18
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
|
21
19
|
*
|
|
22
20
|
* You can learn more about logging context's here:
|
|
23
|
-
* https://github.com/
|
|
21
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomContext
|
|
24
22
|
*
|
|
25
23
|
* But here's a quick overview / refresher:
|
|
26
24
|
*
|
|
@@ -31,7 +29,7 @@
|
|
|
31
29
|
* For example, logically separate parts of your app each have a different logging context.
|
|
32
30
|
* Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context.
|
|
33
31
|
**/
|
|
34
|
-
@interface
|
|
32
|
+
@interface DDContextWhitelistFilterLogFormatter : NSObject <DDLogFormatter>
|
|
35
33
|
|
|
36
34
|
- (id)init;
|
|
37
35
|
|
|
@@ -51,7 +49,7 @@
|
|
|
51
49
|
/**
|
|
52
50
|
* This class provides a log formatter that filters log statements from a logging context on the blacklist.
|
|
53
51
|
**/
|
|
54
|
-
@interface
|
|
52
|
+
@interface DDContextBlacklistFilterLogFormatter : NSObject <DDLogFormatter>
|
|
55
53
|
|
|
56
54
|
- (id)init;
|
|
57
55
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
#import "
|
|
1
|
+
#import "DDContextFilterLogFormatter.h"
|
|
2
2
|
#import <libkern/OSAtomic.h>
|
|
3
3
|
|
|
4
4
|
/**
|
|
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/
|
|
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/
|
|
11
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
12
12
|
**/
|
|
13
13
|
|
|
14
14
|
#if ! __has_feature(objc_arc)
|
|
15
15
|
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
|
16
16
|
#endif
|
|
17
17
|
|
|
18
|
-
@interface
|
|
18
|
+
@interface DDLoggingContextSet : NSObject
|
|
19
19
|
|
|
20
20
|
- (void)addToSet:(int)loggingContext;
|
|
21
21
|
- (void)removeFromSet:(int)loggingContext;
|
|
@@ -30,47 +30,47 @@
|
|
|
30
30
|
#pragma mark -
|
|
31
31
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
32
32
|
|
|
33
|
-
@implementation
|
|
33
|
+
@implementation DDContextWhitelistFilterLogFormatter
|
|
34
34
|
{
|
|
35
|
-
|
|
35
|
+
DDLoggingContextSet *contextSet;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
- (id)init
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
if ((self = [super init]))
|
|
41
|
+
{
|
|
42
|
+
contextSet = [[DDLoggingContextSet alloc] init];
|
|
43
|
+
}
|
|
44
|
+
return self;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
- (void)addToWhitelist:(int)loggingContext
|
|
49
49
|
{
|
|
50
|
-
|
|
50
|
+
[contextSet addToSet:loggingContext];
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
- (void)removeFromWhitelist:(int)loggingContext
|
|
54
54
|
{
|
|
55
|
-
|
|
55
|
+
[contextSet removeFromSet:loggingContext];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
- (NSArray *)whitelist
|
|
59
59
|
{
|
|
60
|
-
|
|
60
|
+
return [contextSet currentSet];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
- (BOOL)isOnWhitelist:(int)loggingContext
|
|
64
64
|
{
|
|
65
|
-
|
|
65
|
+
return [contextSet isInSet:loggingContext];
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage
|
|
69
69
|
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
if ([self isOnWhitelist:logMessage->logContext])
|
|
71
|
+
return logMessage->logMsg;
|
|
72
|
+
else
|
|
73
|
+
return nil;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
@end
|
|
@@ -79,47 +79,47 @@
|
|
|
79
79
|
#pragma mark -
|
|
80
80
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
81
81
|
|
|
82
|
-
@implementation
|
|
82
|
+
@implementation DDContextBlacklistFilterLogFormatter
|
|
83
83
|
{
|
|
84
|
-
|
|
84
|
+
DDLoggingContextSet *contextSet;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
- (id)init
|
|
88
88
|
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
if ((self = [super init]))
|
|
90
|
+
{
|
|
91
|
+
contextSet = [[DDLoggingContextSet alloc] init];
|
|
92
|
+
}
|
|
93
|
+
return self;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
- (void)addToBlacklist:(int)loggingContext
|
|
98
98
|
{
|
|
99
|
-
|
|
99
|
+
[contextSet addToSet:loggingContext];
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
- (void)removeFromBlacklist:(int)loggingContext
|
|
103
103
|
{
|
|
104
|
-
|
|
104
|
+
[contextSet removeFromSet:loggingContext];
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
- (NSArray *)blacklist
|
|
108
108
|
{
|
|
109
|
-
|
|
109
|
+
return [contextSet currentSet];
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
- (BOOL)isOnBlacklist:(int)loggingContext
|
|
113
113
|
{
|
|
114
|
-
|
|
114
|
+
return [contextSet isInSet:loggingContext];
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage
|
|
118
118
|
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
if ([self isOnBlacklist:logMessage->logContext])
|
|
120
|
+
return nil;
|
|
121
|
+
else
|
|
122
|
+
return logMessage->logMsg;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
@end
|
|
@@ -128,64 +128,64 @@
|
|
|
128
128
|
#pragma mark -
|
|
129
129
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
130
130
|
|
|
131
|
-
@implementation
|
|
131
|
+
@implementation DDLoggingContextSet
|
|
132
132
|
{
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
OSSpinLock lock;
|
|
134
|
+
NSMutableSet *set;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
- (id)init
|
|
138
138
|
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
if ((self = [super init]))
|
|
140
|
+
{
|
|
141
|
+
set = [[NSMutableSet alloc] init];
|
|
142
|
+
}
|
|
143
|
+
return self;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
- (void)addToSet:(int)loggingContext
|
|
148
148
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
OSSpinLockLock(&lock);
|
|
150
|
+
{
|
|
151
|
+
[set addObject:@(loggingContext)];
|
|
152
|
+
}
|
|
153
|
+
OSSpinLockUnlock(&lock);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
- (void)removeFromSet:(int)loggingContext
|
|
157
157
|
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
OSSpinLockLock(&lock);
|
|
159
|
+
{
|
|
160
|
+
[set removeObject:@(loggingContext)];
|
|
161
|
+
}
|
|
162
|
+
OSSpinLockUnlock(&lock);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
- (NSArray *)currentSet
|
|
166
166
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
NSArray *result = nil;
|
|
168
|
+
|
|
169
|
+
OSSpinLockLock(&lock);
|
|
170
|
+
{
|
|
171
|
+
result = [set allObjects];
|
|
172
|
+
}
|
|
173
|
+
OSSpinLockUnlock(&lock);
|
|
174
|
+
|
|
175
|
+
return result;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
- (BOOL)isInSet:(int)loggingContext
|
|
179
179
|
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
180
|
+
BOOL result = NO;
|
|
181
|
+
|
|
182
|
+
OSSpinLockLock(&lock);
|
|
183
|
+
{
|
|
184
|
+
result = [set containsObject:@(loggingContext)];
|
|
185
|
+
}
|
|
186
|
+
OSSpinLockUnlock(&lock);
|
|
187
|
+
|
|
188
|
+
return result;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
@end
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* Welcome to Cocoa Lumberjack!
|
|
8
8
|
*
|
|
9
9
|
* The project page has a wealth of documentation if you have any questions.
|
|
10
|
-
* https://github.com/
|
|
10
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
11
11
|
*
|
|
12
12
|
* If you're new to the project you may wish to read the "Getting Started" page.
|
|
13
|
-
* https://github.com/
|
|
13
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
14
14
|
*
|
|
15
15
|
*
|
|
16
16
|
* This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id.
|
|
17
17
|
*
|
|
18
18
|
* A log formatter can be added to any logger to format and/or filter its output.
|
|
19
19
|
* You can learn more about log formatters here:
|
|
20
|
-
* https://github.com/
|
|
20
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
|
21
21
|
*
|
|
22
22
|
* A typical NSLog (or DDTTYLogger) prints detailed info as [<process_id>:<thread_id>].
|
|
23
23
|
* For example:
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
* Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread),
|
|
50
50
|
* you can use [[NSThread currentThread] setName:(NSString *)].
|
|
51
51
|
**/
|
|
52
|
-
@interface
|
|
52
|
+
@interface DDDispatchQueueLogFormatter : NSObject <DDLogFormatter> {
|
|
53
53
|
@protected
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
|
|
55
|
+
NSString *dateFormatString;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -114,3 +114,15 @@
|
|
|
114
114
|
- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel;
|
|
115
115
|
|
|
116
116
|
@end
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Method declarations that make it easier to extend/modify DDDispatchQueueLogFormatter
|
|
120
|
+
**/
|
|
121
|
+
@interface DDDispatchQueueLogFormatter (OverridableMethods)
|
|
122
|
+
|
|
123
|
+
- (NSString *)stringFromDate:(NSDate *)date;
|
|
124
|
+
- (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage;
|
|
125
|
+
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage;
|
|
126
|
+
|
|
127
|
+
@end
|
|
128
|
+
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
#import "DDDispatchQueueLogFormatter.h"
|
|
2
|
+
#import <libkern/OSAtomic.h>
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Welcome to Cocoa Lumberjack!
|
|
6
|
+
*
|
|
7
|
+
* The project page has a wealth of documentation if you have any questions.
|
|
8
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
9
|
+
*
|
|
10
|
+
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
|
11
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
12
|
+
**/
|
|
13
|
+
|
|
14
|
+
#if ! __has_feature(objc_arc)
|
|
15
|
+
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@implementation DDDispatchQueueLogFormatter
|
|
20
|
+
{
|
|
21
|
+
int32_t atomicLoggerCount;
|
|
22
|
+
NSDateFormatter *threadUnsafeDateFormatter; // Use [self stringFromDate]
|
|
23
|
+
|
|
24
|
+
OSSpinLock lock;
|
|
25
|
+
|
|
26
|
+
NSUInteger _minQueueLength; // _prefix == Only access via atomic property
|
|
27
|
+
NSUInteger _maxQueueLength; // _prefix == Only access via atomic property
|
|
28
|
+
NSMutableDictionary *_replacements; // _prefix == Only access from within spinlock
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
- (id)init
|
|
32
|
+
{
|
|
33
|
+
if ((self = [super init]))
|
|
34
|
+
{
|
|
35
|
+
dateFormatString = @"yyyy-MM-dd HH:mm:ss:SSS";
|
|
36
|
+
|
|
37
|
+
atomicLoggerCount = 0;
|
|
38
|
+
threadUnsafeDateFormatter = nil;
|
|
39
|
+
|
|
40
|
+
_minQueueLength = 0;
|
|
41
|
+
_maxQueueLength = 0;
|
|
42
|
+
_replacements = [[NSMutableDictionary alloc] init];
|
|
43
|
+
|
|
44
|
+
// Set default replacements:
|
|
45
|
+
|
|
46
|
+
_replacements[@"com.apple.main-thread"] = @"main";
|
|
47
|
+
}
|
|
48
|
+
return self;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
53
|
+
#pragma mark Configuration
|
|
54
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
55
|
+
|
|
56
|
+
@synthesize minQueueLength = _minQueueLength;
|
|
57
|
+
@synthesize maxQueueLength = _maxQueueLength;
|
|
58
|
+
|
|
59
|
+
- (NSString *)replacementStringForQueueLabel:(NSString *)longLabel
|
|
60
|
+
{
|
|
61
|
+
NSString *result = nil;
|
|
62
|
+
|
|
63
|
+
OSSpinLockLock(&lock);
|
|
64
|
+
{
|
|
65
|
+
result = _replacements[longLabel];
|
|
66
|
+
}
|
|
67
|
+
OSSpinLockUnlock(&lock);
|
|
68
|
+
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel
|
|
73
|
+
{
|
|
74
|
+
OSSpinLockLock(&lock);
|
|
75
|
+
{
|
|
76
|
+
if (shortLabel)
|
|
77
|
+
_replacements[longLabel] = shortLabel;
|
|
78
|
+
else
|
|
79
|
+
[_replacements removeObjectForKey:longLabel];
|
|
80
|
+
}
|
|
81
|
+
OSSpinLockUnlock(&lock);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
85
|
+
#pragma mark DDLogFormatter
|
|
86
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
87
|
+
|
|
88
|
+
- (NSString *)stringFromDate:(NSDate *)date
|
|
89
|
+
{
|
|
90
|
+
int32_t loggerCount = OSAtomicAdd32(0, &atomicLoggerCount);
|
|
91
|
+
|
|
92
|
+
if (loggerCount <= 1)
|
|
93
|
+
{
|
|
94
|
+
// Single-threaded mode.
|
|
95
|
+
|
|
96
|
+
if (threadUnsafeDateFormatter == nil)
|
|
97
|
+
{
|
|
98
|
+
threadUnsafeDateFormatter = [[NSDateFormatter alloc] init];
|
|
99
|
+
[threadUnsafeDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
|
|
100
|
+
[threadUnsafeDateFormatter setDateFormat:dateFormatString];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[threadUnsafeDateFormatter setCalendar:[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]];
|
|
104
|
+
return [threadUnsafeDateFormatter stringFromDate:date];
|
|
105
|
+
}
|
|
106
|
+
else
|
|
107
|
+
{
|
|
108
|
+
// Multi-threaded mode.
|
|
109
|
+
// NSDateFormatter is NOT thread-safe.
|
|
110
|
+
|
|
111
|
+
NSString *key = @"DispatchQueueLogFormatter_NSDateFormatter";
|
|
112
|
+
|
|
113
|
+
NSMutableDictionary *threadDictionary = [[NSThread currentThread] threadDictionary];
|
|
114
|
+
NSDateFormatter *dateFormatter = threadDictionary[key];
|
|
115
|
+
|
|
116
|
+
if (dateFormatter == nil)
|
|
117
|
+
{
|
|
118
|
+
dateFormatter = [[NSDateFormatter alloc] init];
|
|
119
|
+
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
|
|
120
|
+
[dateFormatter setDateFormat:dateFormatString];
|
|
121
|
+
|
|
122
|
+
threadDictionary[key] = dateFormatter;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[dateFormatter setCalendar:[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]];
|
|
126
|
+
return [dateFormatter stringFromDate:date];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
- (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage
|
|
131
|
+
{
|
|
132
|
+
// As per the DDLogFormatter contract, this method is always invoked on the same thread/dispatch_queue
|
|
133
|
+
|
|
134
|
+
NSUInteger minQueueLength = self.minQueueLength;
|
|
135
|
+
NSUInteger maxQueueLength = self.maxQueueLength;
|
|
136
|
+
|
|
137
|
+
// Get the name of the queue, thread, or machID (whichever we are to use).
|
|
138
|
+
|
|
139
|
+
NSString *queueThreadLabel = nil;
|
|
140
|
+
|
|
141
|
+
BOOL useQueueLabel = YES;
|
|
142
|
+
BOOL useThreadName = NO;
|
|
143
|
+
|
|
144
|
+
if (logMessage->queueLabel)
|
|
145
|
+
{
|
|
146
|
+
// If you manually create a thread, it's dispatch_queue will have one of the thread names below.
|
|
147
|
+
// Since all such threads have the same name, we'd prefer to use the threadName or the machThreadID.
|
|
148
|
+
|
|
149
|
+
char *names[] = { "com.apple.root.low-priority",
|
|
150
|
+
"com.apple.root.default-priority",
|
|
151
|
+
"com.apple.root.high-priority",
|
|
152
|
+
"com.apple.root.low-overcommit-priority",
|
|
153
|
+
"com.apple.root.default-overcommit-priority",
|
|
154
|
+
"com.apple.root.high-overcommit-priority" };
|
|
155
|
+
|
|
156
|
+
int length = sizeof(names) / sizeof(char *);
|
|
157
|
+
|
|
158
|
+
int i;
|
|
159
|
+
for (i = 0; i < length; i++)
|
|
160
|
+
{
|
|
161
|
+
if (strcmp(logMessage->queueLabel, names[i]) == 0)
|
|
162
|
+
{
|
|
163
|
+
useQueueLabel = NO;
|
|
164
|
+
useThreadName = [logMessage->threadName length] > 0;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else
|
|
170
|
+
{
|
|
171
|
+
useQueueLabel = NO;
|
|
172
|
+
useThreadName = [logMessage->threadName length] > 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (useQueueLabel || useThreadName)
|
|
176
|
+
{
|
|
177
|
+
NSString *fullLabel;
|
|
178
|
+
NSString *abrvLabel;
|
|
179
|
+
|
|
180
|
+
if (useQueueLabel)
|
|
181
|
+
fullLabel = @(logMessage->queueLabel);
|
|
182
|
+
else
|
|
183
|
+
fullLabel = logMessage->threadName;
|
|
184
|
+
|
|
185
|
+
OSSpinLockLock(&lock);
|
|
186
|
+
{
|
|
187
|
+
abrvLabel = _replacements[fullLabel];
|
|
188
|
+
}
|
|
189
|
+
OSSpinLockUnlock(&lock);
|
|
190
|
+
|
|
191
|
+
if (abrvLabel)
|
|
192
|
+
queueThreadLabel = abrvLabel;
|
|
193
|
+
else
|
|
194
|
+
queueThreadLabel = fullLabel;
|
|
195
|
+
}
|
|
196
|
+
else
|
|
197
|
+
{
|
|
198
|
+
queueThreadLabel = [NSString stringWithFormat:@"%x", logMessage->machThreadID];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Now use the thread label in the output
|
|
202
|
+
|
|
203
|
+
NSUInteger labelLength = [queueThreadLabel length];
|
|
204
|
+
|
|
205
|
+
// labelLength > maxQueueLength : truncate
|
|
206
|
+
// labelLength < minQueueLength : padding
|
|
207
|
+
// : exact
|
|
208
|
+
|
|
209
|
+
if ((maxQueueLength > 0) && (labelLength > maxQueueLength))
|
|
210
|
+
{
|
|
211
|
+
// Truncate
|
|
212
|
+
|
|
213
|
+
return [queueThreadLabel substringToIndex:maxQueueLength];
|
|
214
|
+
}
|
|
215
|
+
else if (labelLength < minQueueLength)
|
|
216
|
+
{
|
|
217
|
+
// Padding
|
|
218
|
+
|
|
219
|
+
NSUInteger numSpaces = minQueueLength - labelLength;
|
|
220
|
+
|
|
221
|
+
char spaces[numSpaces + 1];
|
|
222
|
+
memset(spaces, ' ', numSpaces);
|
|
223
|
+
spaces[numSpaces] = '\0';
|
|
224
|
+
|
|
225
|
+
return [NSString stringWithFormat:@"%@%s", queueThreadLabel, spaces];
|
|
226
|
+
}
|
|
227
|
+
else
|
|
228
|
+
{
|
|
229
|
+
// Exact
|
|
230
|
+
|
|
231
|
+
return queueThreadLabel;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage
|
|
236
|
+
{
|
|
237
|
+
NSString *timestamp = [self stringFromDate:(logMessage->timestamp)];
|
|
238
|
+
NSString *queueThreadLabel = [self queueThreadLabelForLogMessage:logMessage];
|
|
239
|
+
|
|
240
|
+
return [NSString stringWithFormat:@"%@ [%@] %@", timestamp, queueThreadLabel, logMessage->logMsg];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
- (void)didAddToLogger:(id <DDLogger>)logger
|
|
244
|
+
{
|
|
245
|
+
OSAtomicIncrement32(&atomicLoggerCount);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
- (void)willRemoveFromLogger:(id <DDLogger>)logger
|
|
249
|
+
{
|
|
250
|
+
OSAtomicDecrement32(&atomicLoggerCount);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@end
|