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