diff --git a/Cartfile.private b/Cartfile.private index b1c1cc29b..87601c033 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,4 +1,5 @@ github "specta/expecta" "master" -github "jmoody/specta" "feature/do-not-create-sharedExampleGroup-instances-in-initialize" +github "specta/specta" "main" github "erikdoe/ocmock" "master" +github "CocoaLumberjack/CocoaLumberjack" \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved index 01b942478..5f7a36875 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,4 @@ -github "erikdoe/ocmock" "b9c7fb949d7afc7087165b9c57fb5d7ddbe2ce4d" -github "jmoody/specta" "d539c58fe4bc3326282e4e8496e14a0ab1265992" +github "CocoaLumberjack/CocoaLumberjack" "3.8.0" +github "erikdoe/ocmock" "05cbc9d934e84ad32530fa53fd7d29c7966d5828" github "specta/expecta" "fc2dd8bf29b8e4edbfeb4639a98b5d87bea03e19" +github "specta/specta" "d95dca07a4b7b96f587a91b17aefa92dfb18c955" diff --git a/Carthage/Build/CocoaLumberjack.xcframework/Info.plist b/Carthage/Build/CocoaLumberjack.xcframework/Info.plist new file mode 100644 index 000000000..7cd4f8afc --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/Info.plist @@ -0,0 +1,124 @@ + + + + + AvailableLibraries + + + DebugSymbolsPath + dSYMs + LibraryIdentifier + tvos-arm64_x86_64-simulator + LibraryPath + CocoaLumberjack.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + tvos + SupportedPlatformVariant + simulator + + + DebugSymbolsPath + dSYMs + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + CocoaLumberjack.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + DebugSymbolsPath + dSYMs + LibraryIdentifier + watchos-arm64_i386_x86_64-simulator + LibraryPath + CocoaLumberjack.framework + SupportedArchitectures + + arm64 + i386 + x86_64 + + SupportedPlatform + watchos + SupportedPlatformVariant + simulator + + + DebugSymbolsPath + dSYMs + LibraryIdentifier + watchos-arm64_arm64_32_armv7k + LibraryPath + CocoaLumberjack.framework + SupportedArchitectures + + arm64 + arm64_32 + armv7k + + SupportedPlatform + watchos + + + DebugSymbolsPath + dSYMs + LibraryIdentifier + ios-arm64 + LibraryPath + CocoaLumberjack.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + DebugSymbolsPath + dSYMs + LibraryIdentifier + tvos-arm64 + LibraryPath + CocoaLumberjack.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + tvos + + + DebugSymbolsPath + dSYMs + LibraryIdentifier + macos-arm64_x86_64 + LibraryPath + CocoaLumberjack.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/CocoaLumberjack b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/CocoaLumberjack new file mode 100755 index 000000000..7ac27952f Binary files /dev/null and b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/CocoaLumberjack differ diff --git a/LPTestTarget/CocoaLumberjack/CLI/CLIColor.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/CLIColor.h similarity index 75% rename from LPTestTarget/CocoaLumberjack/CLI/CLIColor.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/CLIColor.h index cfa0909cb..e93056623 100644 --- a/LPTestTarget/CocoaLumberjack/CLI/CLIColor.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/CLIColor.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -13,9 +13,15 @@ // to endorse or promote products derived from this software without specific // prior written permission of Deusty, LLC. +#import + +#if TARGET_OS_OSX + #import #import +NS_ASSUME_NONNULL_BEGIN + /** * This class represents an NSColor replacement for CLI projects that don't link with AppKit **/ @@ -29,7 +35,7 @@ * @param blue blue channel, between 0 and 1 * @param alpha alpha channel, between 0 and 1 */ -+ (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; ++ (instancetype)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; /** * Get the RGBA components from a `CLIColor` @@ -39,6 +45,10 @@ * @param blue blue channel, between 0 and 1 * @param alpha alpha channel, between 0 and 1 */ -- (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha; +- (void)getRed:(nullable CGFloat *)red green:(nullable CGFloat *)green blue:(nullable CGFloat *)blue alpha:(nullable CGFloat *)alpha NS_SWIFT_NAME(get(red:green:blue:alpha:)); @end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/LPTestTarget/CocoaLumberjack/CocoaLumberjack.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/CocoaLumberjack.h similarity index 66% rename from LPTestTarget/CocoaLumberjack/CocoaLumberjack.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/CocoaLumberjack.h index 0b568fb09..8082d6ec4 100644 --- a/LPTestTarget/CocoaLumberjack/CocoaLumberjack.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/CocoaLumberjack.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -59,23 +59,46 @@ #import +//! Project version number for CocoaLumberjack. +FOUNDATION_EXPORT double CocoaLumberjackVersionNumber; + +//! Project version string for CocoaLumberjack. +FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[]; + // Disable legacy macros #ifndef DD_LEGACY_MACROS #define DD_LEGACY_MACROS 0 #endif // Core -#import "DDLog.h" +#import // Main macros -#import "DDLogMacros.h" -#import "DDAssertMacros.h" +#import +#import // Capture ASL -#import "DDASLLogCapture.h" +#import // Loggers -#import "DDTTYLogger.h" -#import "DDASLLogger.h" -#import "DDFileLogger.h" +#import + +#import +#import +#import +#import + +// Extensions +#import +#import +#import +#import +#import + +// CLI +#import +// etc +#import +#import +#import diff --git a/LPTestTarget/CocoaLumberjack/DDASLLogCapture.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDASLLogCapture.h similarity index 74% rename from LPTestTarget/CocoaLumberjack/DDASLLogCapture.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDASLLogCapture.h index f7fa79f3c..7c5d8e384 100644 --- a/LPTestTarget/CocoaLumberjack/DDASLLogCapture.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDASLLogCapture.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -13,13 +13,16 @@ // to endorse or promote products derived from this software without specific // prior written permission of Deusty, LLC. -#import "DDASLLogger.h" +#import @protocol DDLogger; +NS_ASSUME_NONNULL_BEGIN + /** * This class provides the ability to capture the ASL (Apple System Logs) */ +API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) @interface DDASLLogCapture : NSObject /** @@ -33,16 +36,11 @@ + (void)stop; /** - * Returns the current capture level. + * The current capture level. * @note Default log level: DDLogLevelVerbose (i.e. capture all ASL messages). */ -+ (DDLogLevel)captureLevel; - -/** - * Set the capture level - * - * @param level new level - */ -+ (void)setCaptureLevel:(DDLogLevel)level; +@property (class) DDLogLevel captureLevel; @end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/DDASLLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDASLLogger.h similarity index 84% rename from LPTestTarget/CocoaLumberjack/DDASLLogger.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDASLLogger.h index 24cc1c3d1..65bae5cc8 100644 --- a/LPTestTarget/CocoaLumberjack/DDASLLogger.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDASLLogger.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -20,7 +20,9 @@ #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import + +NS_ASSUME_NONNULL_BEGIN // Custom key set on messages sent to ASL extern const char* const kDDASLKeyDDLog; @@ -41,6 +43,7 @@ extern const char* const kDDASLDDLogValue; * However, if you instead choose to use file logging (for faster performance), * you may choose to use a file logger and a tty logger. **/ +API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) @interface DDASLLogger : DDAbstractLogger /** @@ -48,7 +51,7 @@ extern const char* const kDDASLDDLogValue; * * @return the shared instance */ -+ (instancetype)sharedInstance; +@property (nonatomic, class, readonly, strong) DDASLLogger *sharedInstance; // Inherited from DDAbstractLogger @@ -56,3 +59,5 @@ extern const char* const kDDASLDDLogValue; // - (void)setLogFormatter:(id )formatter; @end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/DDAbstractDatabaseLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h similarity index 96% rename from LPTestTarget/CocoaLumberjack/DDAbstractDatabaseLogger.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h index aad36661e..281690e49 100644 --- a/LPTestTarget/CocoaLumberjack/DDAbstractDatabaseLogger.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -18,7 +18,9 @@ #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import + +NS_ASSUME_NONNULL_BEGIN /** * This class provides an abstract implementation of a database logger. @@ -36,7 +38,7 @@ NSTimeInterval _deleteInterval; BOOL _deleteOnEverySave; - BOOL _saveTimerSuspended; + NSInteger _saveTimerSuspended; NSUInteger _unsavedCount; dispatch_time_t _unsavedTime; dispatch_source_t _saveTimer; @@ -121,3 +123,5 @@ - (void)deleteOldLogEntries; @end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/DDAssertMacros.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDAssertMacros.h similarity index 75% rename from LPTestTarget/CocoaLumberjack/DDAssertMacros.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDAssertMacros.h index 870d31f5d..f4b7d58ff 100644 --- a/LPTestTarget/CocoaLumberjack/DDAssertMacros.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDAssertMacros.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -14,13 +14,17 @@ // prior written permission of Deusty, LLC. /** - * NSAsset replacement that will output a log message even when assertions are disabled. + * NSAssert replacement that will output a log message even when assertions are disabled. **/ #define DDAssert(condition, frmt, ...) \ if (!(condition)) { \ NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ DDLogError(@"%@", description); \ - NSAssert(NO, description); \ + NSAssert(NO, @"%@", description); \ } #define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition) +/** + * Analog to `DDAssertionFailure` from DDAssert.swift for use in Objective C + */ +#define DDAssertionFailure(frmt, ...) DDAssert(NO, frmt, ##__VA_ARGS__) diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter+Deprecated.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter+Deprecated.h new file mode 100644 index 000000000..3dcc6af32 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter+Deprecated.h @@ -0,0 +1,119 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a log formatter that filters log statements from a logging context not on the whitelist. + * @deprecated Use DDContextAllowlistFilterLogFormatter instead. + * + * A log formatter can be added to any logger to format and/or filter its output. + * You can learn more about log formatters here: + * Documentation/CustomFormatters.md + * + * You can learn more about logging context's here: + * Documentation/CustomContext.md + * + * But here's a quick overview / refresher: + * + * Every log statement has a logging context. + * These come from the underlying logging macros defined in DDLog.h. + * The default logging context is zero. + * You can define multiple logging context's for use in your application. + * For example, logically separate parts of your app each have a different logging context. + * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. + **/ +__attribute__((deprecated("Use DDContextAllowlistFilterLogFormatter instead"))) +typedef DDContextAllowlistFilterLogFormatter DDContextWhitelistFilterLogFormatter; + +@interface DDContextAllowlistFilterLogFormatter (Deprecated) + +/** + * Add a context to the whitelist + * @deprecated Use -addToAllowlist: instead. + * + * @param loggingContext the context + */ +- (void)addToWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -addToAllowlist: instead"))); + +/** + * Remove context from whitelist + * @deprecated Use -removeFromAllowlist: instead. + * + * @param loggingContext the context + */ +- (void)removeFromWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -removeFromAllowlist: instead"))); + +/** + * Return the whitelist + * @deprecated Use allowlist instead. + */ +@property (nonatomic, readonly, copy) NSArray *whitelist __attribute__((deprecated("Use allowlist instead"))); + +/** + * Check if a context is on the whitelist + * @deprecated Use -isOnAllowlist: instead. + * + * @param loggingContext the context + */ +- (BOOL)isOnWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -isOnAllowlist: instead"))); + +@end + + +/** + * This class provides a log formatter that filters log statements from a logging context on the blacklist. + * @deprecated Use DDContextDenylistFilterLogFormatter instead. + **/ +__attribute__((deprecated("Use DDContextDenylistFilterLogFormatter instead"))) +typedef DDContextDenylistFilterLogFormatter DDContextBlacklistFilterLogFormatter; + +@interface DDContextDenylistFilterLogFormatter (Deprecated) + +/** + * Add a context to the blacklist + * @deprecated Use -addToDenylist: instead. + * + * @param loggingContext the context + */ +- (void)addToBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -addToDenylist: instead"))); + +/** + * Remove context from blacklist + * @deprecated Use -removeFromDenylist: instead. + * + * @param loggingContext the context + */ +- (void)removeFromBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -removeFromDenylist: instead"))); + +/** + * Return the blacklist + * @deprecated Use denylist instead. + */ +@property (readonly, copy) NSArray *blacklist __attribute__((deprecated("Use denylist instead"))); + +/** + * Check if a context is on the blacklist + * @deprecated Use -isOnDenylist: instead. + * + * @param loggingContext the context + */ +- (BOOL)isOnBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -isOnDenylist: instead"))); + +@end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/Extensions/DDContextFilterLogFormatter.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h similarity index 62% rename from LPTestTarget/CocoaLumberjack/Extensions/DDContextFilterLogFormatter.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h index 1657f1fd2..61d37aa8f 100644 --- a/LPTestTarget/CocoaLumberjack/Extensions/DDContextFilterLogFormatter.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -20,10 +20,12 @@ #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import + +NS_ASSUME_NONNULL_BEGIN /** - * This class provides a log formatter that filters log statements from a logging context not on the whitelist. + * This class provides a log formatter that filters log statements from a logging context not on the allowlist. * * A log formatter can be added to any logger to format and/or filter its output. * You can learn more about log formatters here: @@ -41,7 +43,7 @@ * For example, logically separate parts of your app each have a different logging context. * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. **/ -@interface DDContextWhitelistFilterLogFormatter : NSObject +@interface DDContextAllowlistFilterLogFormatter : NSObject /** * Designated default initializer @@ -49,69 +51,67 @@ - (instancetype)init NS_DESIGNATED_INITIALIZER; /** - * Add a context to the whitelist + * Add a context to the allowlist * * @param loggingContext the context */ -- (void)addToWhitelist:(NSUInteger)loggingContext; +- (void)addToAllowlist:(NSInteger)loggingContext; /** - * Remove context from whitelist + * Remove context from allowlist * * @param loggingContext the context */ -- (void)removeFromWhitelist:(NSUInteger)loggingContext; +- (void)removeFromAllowlist:(NSInteger)loggingContext; /** - * Return the whitelist + * Return the allowlist */ -@property (readonly, copy) NSArray *whitelist; +@property (nonatomic, readonly, copy) NSArray *allowlist; /** - * Check if a context is on the whitelist + * Check if a context is on the allowlist * * @param loggingContext the context */ -- (BOOL)isOnWhitelist:(NSUInteger)loggingContext; +- (BOOL)isOnAllowlist:(NSInteger)loggingContext; @end -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * This class provides a log formatter that filters log statements from a logging context on the blacklist. + * This class provides a log formatter that filters log statements from a logging context on the denylist. **/ -@interface DDContextBlacklistFilterLogFormatter : NSObject +@interface DDContextDenylistFilterLogFormatter : NSObject - (instancetype)init NS_DESIGNATED_INITIALIZER; /** - * Add a context to the blacklist + * Add a context to the denylist * * @param loggingContext the context */ -- (void)addToBlacklist:(NSUInteger)loggingContext; +- (void)addToDenylist:(NSInteger)loggingContext; /** - * Remove context from blacklist + * Remove context from denylist * * @param loggingContext the context */ -- (void)removeFromBlacklist:(NSUInteger)loggingContext; +- (void)removeFromDenylist:(NSInteger)loggingContext; /** - * Return the blacklist + * Return the denylist */ -@property (readonly, copy) NSArray *blacklist; - +@property (readonly, copy) NSArray *denylist; /** - * Check if a context is on the blacklist + * Check if a context is on the denylist * * @param loggingContext the context */ -- (BOOL)isOnBlacklist:(NSUInteger)loggingContext; +- (BOOL)isOnDenylist:(NSInteger)loggingContext; @end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/Extensions/DDDispatchQueueLogFormatter.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h similarity index 69% rename from LPTestTarget/CocoaLumberjack/Extensions/DDDispatchQueueLogFormatter.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h index 129f6e1f0..618cc08eb 100644 --- a/LPTestTarget/CocoaLumberjack/Extensions/DDDispatchQueueLogFormatter.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -14,18 +14,20 @@ // prior written permission of Deusty, LLC. #import -#import // Disable legacy macros #ifndef DD_LEGACY_MACROS #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import + +NS_ASSUME_NONNULL_BEGIN /** * Log formatter mode */ +__attribute__((deprecated("DDDispatchQueueLogFormatter is always shareable"))) typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ /** * This is the default option, means the formatter can be reused between multiple loggers and therefore is thread-safe. @@ -39,6 +41,36 @@ typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ DDDispatchQueueLogFormatterModeNonShareble, }; +/** + * Quality of Service names. + * + * Since macOS 10.10 and iOS 8.0, pthreads, dispatch queues and NSOperations express their + * scheduling priority by using an abstract classification called Quality of Service (QOS). + * + * This formatter will add a representation of this QOS in the log message by using those + * string constants. + * For example: + * + * `2011-10-17 20:21:45.435 AppName[19928:5207 (QOS:DF)] Your log message here` + * + * Where QOS is one of: + * `- UI = User Interactive` + * `- IN = User Initiated` + * `- DF = Default` + * `- UT = Utility` + * `- BG = Background` + * `- UN = Unspecified` + * + * Note: QOS will be absent in the log messages if running on OS versions that don't support it. + **/ +typedef NSString * DDQualityOfServiceName NS_STRING_ENUM; + +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUserInteractive NS_SWIFT_NAME(DDQualityOfServiceName.userInteractive) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUserInitiated NS_SWIFT_NAME(DDQualityOfServiceName.userInitiated) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceDefault NS_SWIFT_NAME(DDQualityOfServiceName.default) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUtility NS_SWIFT_NAME(DDQualityOfServiceName.utility) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceBackground NS_SWIFT_NAME(DDQualityOfServiceName.background) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUnspecified NS_SWIFT_NAME(DDQualityOfServiceName.unspecified) API_AVAILABLE(macos(10.10), ios(8.0)); /** * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id. @@ -90,7 +122,7 @@ typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ * * @param mode choose between DDDispatchQueueLogFormatterModeShareble and DDDispatchQueueLogFormatterModeNonShareble, depending if the formatter is shared between several loggers or not */ -- (instancetype)initWithMode:(DDDispatchQueueLogFormatterMode)mode; +- (instancetype)initWithMode:(DDDispatchQueueLogFormatterMode)mode __attribute__((deprecated("DDDispatchQueueLogFormatter is always shareable"))); /** * The minQueueLength restricts the minimum size of the [detail box]. @@ -141,12 +173,12 @@ typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ * * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter. **/ -- (NSString *)replacementStringForQueueLabel:(NSString *)longLabel; +- (nullable NSString *)replacementStringForQueueLabel:(NSString *)longLabel; /** * See the `replacementStringForQueueLabel:` description */ -- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel; +- (void)setReplacementString:(nullable NSString *)shortLabel forQueueLabel:(NSString *)longLabel; @end @@ -170,9 +202,22 @@ typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ */ - (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage; -/** - * The actual method that formats a message (transforms a `DDLogMessage` model into a printable string) - */ -- (NSString *)formatLogMessage:(DDLogMessage *)logMessage; +@end + +#pragma mark - DDAtomicCountable + +__attribute__((deprecated("DDAtomicCountable is useless since DDDispatchQueueLogFormatter is always shareable now"))) +@protocol DDAtomicCountable +- (instancetype)initWithDefaultValue:(int32_t)defaultValue; +- (int32_t)increment; +- (int32_t)decrement; +- (int32_t)value; + +@end + +__attribute__((deprecated("DDAtomicCountable is deprecated"))) +@interface DDAtomicCounter: NSObject @end + +NS_ASSUME_NONNULL_END diff --git a/calabash/Classes/CocoaLumberjack/LPASLLogCapture.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDFileLogger+Buffering.h similarity index 61% rename from calabash/Classes/CocoaLumberjack/LPASLLogCapture.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDFileLogger+Buffering.h index d2b603484..f4cfcfcf3 100644 --- a/calabash/Classes/CocoaLumberjack/LPASLLogCapture.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDFileLogger+Buffering.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -13,20 +13,15 @@ // to endorse or promote products derived from this software without specific // prior written permission of Deusty, LLC. -#import "LPASLLogger.h" +#import -@protocol LPLogger; +NS_ASSUME_NONNULL_BEGIN -/** - * This class provides the ability to capture the ASL (Apple System Logs) - */ -@interface LPASLLogCapture : NSObject +@interface DDFileLogger (Buffering) -+ (void)start; -+ (void)stop; - -// Default log level: LPLogLevelVerbose (i.e. capture all ASL messages). -+ (LPLogLevel)captureLevel; -+ (void)setCaptureLevel:(LPLogLevel)level; +- (instancetype)wrapWithBuffer; +- (instancetype)unwrapFromBuffer; @end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/DDFileLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDFileLogger.h similarity index 70% rename from LPTestTarget/CocoaLumberjack/DDFileLogger.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDFileLogger.h index 688dd4e34..e18973ba5 100644 --- a/LPTestTarget/CocoaLumberjack/DDFileLogger.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDFileLogger.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -18,10 +18,12 @@ #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import @class DDLogFileInfo; +NS_ASSUME_NONNULL_BEGIN + /** * This class provides a logger to write log statements to a file. **/ @@ -85,7 +87,7 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; @property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles; /** - * The maximum space that logs can take. On rolling logfile all old logfiles that exceed logFilesDiskQuota will + * The maximum space that logs can take. On rolling logfile all old log files that exceed logFilesDiskQuota will * be deleted. * * You may optionally disable this option by setting it to zero. @@ -97,68 +99,84 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; /** * Returns the logs directory (path) */ -- (NSString *)logsDirectory; +@property (nonatomic, readonly, copy) NSString *logsDirectory; /** * Returns an array of `NSString` objects, * each of which is the filePath to an existing log file on disk. **/ -- (NSArray *)unsortedLogFilePaths; +@property (nonatomic, readonly, strong) NSArray *unsortedLogFilePaths; /** * Returns an array of `NSString` objects, * each of which is the fileName of an existing log file on disk. **/ -- (NSArray *)unsortedLogFileNames; +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileNames; /** * Returns an array of `DDLogFileInfo` objects, * each representing an existing log file on disk, * and containing important information about the log file such as it's modification date and size. **/ -- (NSArray *)unsortedLogFileInfos; +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileInfos; /** * Just like the `unsortedLogFilePaths` method, but sorts the array. * The items in the array are sorted by creation date. * The first item in the array will be the most recently created log file. **/ -- (NSArray *)sortedLogFilePaths; +@property (nonatomic, readonly, strong) NSArray *sortedLogFilePaths; /** * Just like the `unsortedLogFileNames` method, but sorts the array. * The items in the array are sorted by creation date. * The first item in the array will be the most recently created log file. **/ -- (NSArray *)sortedLogFileNames; +@property (nonatomic, readonly, strong) NSArray *sortedLogFileNames; /** * Just like the `unsortedLogFileInfos` method, but sorts the array. * The items in the array are sorted by creation date. * The first item in the array will be the most recently created log file. **/ -- (NSArray *)sortedLogFileInfos; +@property (nonatomic, readonly, strong) NSArray *sortedLogFileInfos; // Private methods (only to be used by DDFileLogger) /** * Generates a new unique log file path, and creates the corresponding log file. + * This method is executed directly on the file logger's internal queue. + * The file has to exist by the time the method returns. **/ -- (NSString *)createNewLogFile; +- (nullable NSString *)createNewLogFileWithError:(NSError **)error; @optional +// Private methods (only to be used by DDFileLogger) +/** + * Creates a new log file ignoring any errors. Deprecated in favor of `-createNewLogFileWithError:`. + * Will only be called if `-createNewLogFileWithError:` is not implemented. + **/ +- (nullable NSString *)createNewLogFile __attribute__((deprecated("Use -createNewLogFileWithError:"))) NS_SWIFT_UNAVAILABLE("Use -createNewLogFileWithError:"); + // Notifications from DDFileLogger +/// Called when a log file was archived. Executed on global queue with default priority. +/// @param logFilePath The path to the log file that was archived. +/// @param wasRolled Whether or not the archiving happend after rolling the log file. +- (void)didArchiveLogFile:(NSString *)logFilePath wasRolled:(BOOL)wasRolled NS_SWIFT_NAME(didArchiveLogFile(atPath:wasRolled:)); + +// Deprecated APIs /** - * Called when a log file was archieved + * Called when a log file was archived. Executed on global queue with default priority. */ -- (void)didArchiveLogFile:(NSString *)logFilePath; +- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:)) __attribute__((deprecated("Use -didArchiveLogFile:wasRolled:"))); /** - * Called when the roll action was executed and the log was archieved + * Called when the roll action was executed and the log was archived. + * Executed on global queue with default priority. */ -- (void)didRollAndArchiveLogFile:(NSString *)logFilePath; +- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:)) __attribute__((deprecated("Use -didArchiveLogFile:wasRolled:"))); @end @@ -187,9 +205,10 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; - (instancetype)init; /** - * Designated initialized, requires the logs directory + * If logDirectory is not specified, then a folder called "Logs" is created in the app's cache directory. + * While running on the simulator, the "Logs" folder is located in the library temporary directory. */ -- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithLogsDirectory:(nullable NSString *)logsDirectory NS_DESIGNATED_INITIALIZER; #if TARGET_OS_IPHONE /* @@ -203,7 +222,8 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; * null * cy# **/ -- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory defaultFileProtectionLevel:(NSString *)fileProtectionLevel; +- (instancetype)initWithLogsDirectory:(nullable NSString *)logsDirectory + defaultFileProtectionLevel:(NSFileProtectionType)fileProtectionLevel; #endif /* @@ -214,7 +234,7 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; * * If you wish to change default filename, you can override following two methods. * - `newLogFileName` method would be called on new logfile creation. - * - `isLogFile:` method would be called to filter logfiles from all other files in logsDirectory. + * - `isLogFile:` method would be called to filter log files from all other files in logsDirectory. * You have to parse given filename and return YES if it is logFile. * * **NOTE** @@ -246,7 +266,15 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; * * You can change it by overriding `newLogFileName` and `isLogFile:` methods. **/ -- (BOOL)isLogFile:(NSString *)fileName; +- (BOOL)isLogFile:(NSString *)fileName NS_SWIFT_NAME(isLogFile(withName:)); + +/** + * New log files are created empty by default in `createNewLogFile:` method + * + * If you wish to specify a common file header to use in your log files, + * you can set the initial log file contents by overriding `logFileHeader` + **/ +@property (readonly, copy, nullable) NSString *logFileHeader; /* Inherited from DDLogFileManager protocol: @@ -262,7 +290,6 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; - (NSArray *)sortedLogFilePaths; - (NSArray *)sortedLogFileNames; - (NSArray *)sortedLogFileInfos; - */ @end @@ -291,7 +318,7 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; /** * Designated initializer, requires a date formatter */ -- (instancetype)initWithDateFormatter:(NSDateFormatter *)dateFormatter NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithDateFormatter:(nullable NSDateFormatter *)dateFormatter NS_DESIGNATED_INITIALIZER; @end @@ -305,20 +332,64 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; @interface DDFileLogger : DDAbstractLogger /** - * Default initializer + * Default initializer. */ - (instancetype)init; /** - * Designated initializer, requires a `DDLogFileManager` instance + * Designated initializer, requires a `DDLogFileManager` instance. + * A global queue w/ default priority is used to run callbacks. + * If needed, specify queue using `initWithLogFileManager:completionQueue:`. + */ +- (instancetype)initWithLogFileManager:(id )logFileManager; + +/** + * Designated initializer, requires a `DDLogFileManager` instance. + * The completionQueue is used to execute `didArchiveLogFile:wasRolled:`, + * and the callback in `rollLogFileWithCompletionBlock:`. + * If nil, a global queue w/ default priority is used. + */ +- (instancetype)initWithLogFileManager:(id )logFileManager + completionQueue:(nullable dispatch_queue_t)dispatchQueue NS_DESIGNATED_INITIALIZER; + +/** + * Deprecated. Use `willLogMessage:` + */ +- (void)willLogMessage __attribute__((deprecated("Use -willLogMessage:"))) NS_REQUIRES_SUPER; + +/** + * Deprecated. Use `didLogMessage:` + */ +- (void)didLogMessage __attribute__((deprecated("Use -didLogMessage:"))) NS_REQUIRES_SUPER; + +/** + * Called when the logger is about to write message. Call super before your implementation. */ -- (instancetype)initWithLogFileManager:(id )logFileManager NS_DESIGNATED_INITIALIZER; +- (void)willLogMessage:(DDLogFileInfo *)logFileInfo NS_REQUIRES_SUPER; + +/** + * Called when the logger wrote message. Call super after your implementation. + */ +- (void)didLogMessage:(DDLogFileInfo *)logFileInfo NS_REQUIRES_SUPER; + +/** + * Writes all in-memory log data to the permanent storage. Call super before your implementation. + * Don't call this method directly, instead use the `[DDLog flushLog]` to ensure all log messages are included in flush. + */ +- (void)flush NS_REQUIRES_SUPER; + +/** + * Called when the logger checks archive or not current log file. + * Override this method to extend standard behavior. By default returns NO. + * This is executed directly on the logger's internal queue, so keep processing light! + */ +- (BOOL)shouldArchiveRecentLogFileInfo:(DDLogFileInfo *)recentLogFileInfo; /** * Log File Rolling: * * `maximumFileSize`: - * The approximate maximum size to allow log files to grow. + * The approximate maximum size (in bytes) to allow log files to grow. * If a log file is larger than this value after a log statement is appended, * then the log file is rolled. * @@ -327,6 +398,9 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; * The frequency is given as an `NSTimeInterval`, which is a double that specifies the interval in seconds. * Once the log file gets to be this old, it is rolled. * + * `doNotReuseLogFiles` + * When set, will always create a new log file at application launch. + * * Both the `maximumFileSize` and the `rollingFrequency` are used to manage rolling. * Whichever occurs first will cause the log file to be rolled. * @@ -376,13 +450,14 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; * You can optionally force the current log file to be rolled with this method. * CompletionBlock will be called on main queue. */ -- (void)rollLogFileWithCompletionBlock:(void (^)(void))completionBlock; +- (void)rollLogFileWithCompletionBlock:(nullable void (^)(void))completionBlock + NS_SWIFT_NAME(rollLogFile(withCompletion:)); /** * Method is deprecated. * @deprecated Use `rollLogFileWithCompletionBlock:` method instead. */ -- (void)rollLogFile __attribute((deprecated)); +- (void)rollLogFile __attribute__((deprecated("Use -rollLogFileWithCompletionBlock:"))); // Inherited from DDAbstractLogger @@ -394,9 +469,9 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; * If there is an existing log file that is suitable, * within the constraints of `maximumFileSize` and `rollingFrequency`, then it is returned. * - * Otherwise a new file is created and returned. + * Otherwise a new file is created and returned. If this failes, `NULL` is returned. **/ -- (DDLogFileInfo *)currentLogFileInfo; +@property (nonatomic, nullable, readonly, strong) DDLogFileInfo *currentLogFileInfo; @end @@ -423,65 +498,35 @@ extern unsigned long long const kDDDefaultLogFilesDiskQuota; @property (strong, nonatomic, readonly) NSString *filePath; @property (strong, nonatomic, readonly) NSString *fileName; -@property (strong, nonatomic, readonly) NSDictionary *fileAttributes; +@property (strong, nonatomic, readonly) NSDictionary *fileAttributes; -@property (strong, nonatomic, readonly) NSDate *creationDate; -@property (strong, nonatomic, readonly) NSDate *modificationDate; +@property (strong, nonatomic, nullable, readonly) NSDate *creationDate; +@property (strong, nonatomic, nullable, readonly) NSDate *modificationDate; @property (nonatomic, readonly) unsigned long long fileSize; @property (nonatomic, readonly) NSTimeInterval age; +@property (nonatomic, readonly) BOOL isSymlink; + @property (nonatomic, readwrite) BOOL isArchived; -+ (instancetype)logFileWithPath:(NSString *)filePath; ++ (nullable instancetype)logFileWithPath:(nullable NSString *)filePath NS_SWIFT_UNAVAILABLE("Use init(filePath:)"); - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithFilePath:(NSString *)filePath NS_DESIGNATED_INITIALIZER; - (void)reset; -- (void)renameFile:(NSString *)newFileName; - -#if TARGET_IPHONE_SIMULATOR - -// So here's the situation. -// Extended attributes are perfect for what we're trying to do here (marking files as archived). -// This is exactly what extended attributes were designed for. -// -// But Apple screws us over on the simulator. -// Everytime you build-and-go, they copy the application into a new folder on the hard drive, -// and as part of the process they strip extended attributes from our log files. -// Normally, a copy of a file preserves extended attributes. -// So obviously Apple has gone to great lengths to piss us off. -// -// Thus we use a slightly different tactic for marking log files as archived in the simulator. -// That way it "just works" and there's no confusion when testing. -// -// The difference in method names is indicative of the difference in functionality. -// On the simulator we add an attribute by appending a filename extension. -// -// For example: -// "mylog.txt" -> "mylog.archived.txt" -// "mylog" -> "mylog.archived" - -- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName; - -- (void)addExtensionAttributeWithName:(NSString *)attrName; -- (void)removeExtensionAttributeWithName:(NSString *)attrName; - -#else /* if TARGET_IPHONE_SIMULATOR */ - -// Normal use of extended attributes used everywhere else, -// such as on Macs and on iPhone devices. +- (void)renameFile:(NSString *)newFileName NS_SWIFT_NAME(renameFile(to:)); - (BOOL)hasExtendedAttributeWithName:(NSString *)attrName; - (void)addExtendedAttributeWithName:(NSString *)attrName; - (void)removeExtendedAttributeWithName:(NSString *)attrName; -#endif /* if TARGET_IPHONE_SIMULATOR */ - - (NSComparisonResult)reverseCompareByCreationDate:(DDLogFileInfo *)another; - (NSComparisonResult)reverseCompareByModificationDate:(DDLogFileInfo *)another; @end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/DDLegacyMacros.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLegacyMacros.h similarity index 95% rename from LPTestTarget/CocoaLumberjack/DDLegacyMacros.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLegacyMacros.h index 045ed3a01..dbd6b952c 100644 --- a/LPTestTarget/CocoaLumberjack/DDLegacyMacros.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLegacyMacros.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -20,10 +20,8 @@ **/ #if DD_LEGACY_MACROS -/* #warning CocoaLumberjack 1.9.x legacy macros enabled. \ Disable legacy macros by importing CocoaLumberjack.h or DDLogMacros.h instead of DDLog.h or add `#define DD_LEGACY_MACROS 0` before importing DDLog.h. -*/ #ifndef LOG_LEVEL_DEF #define LOG_LEVEL_DEF ddLogLevel @@ -63,7 +61,7 @@ Disable legacy macros by importing CocoaLumberjack.h or DDLogMacros.h instead of format : (frmt), ## __VA_ARGS__] #define LOG_MAYBE(async, lvl, flg, ctx, fnct, frmt, ...) \ - do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } while(0) + do { if((lvl & flg) != 0) LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } while(0) #define LOG_OBJC_MAYBE(async, lvl, flg, ctx, frmt, ...) \ LOG_MAYBE(async, lvl, flg, ctx, __PRETTY_FUNCTION__, frmt, ## __VA_ARGS__) diff --git a/LPTestTarget/CocoaLumberjack/DDLog+LOGV.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLog+LOGV.h similarity index 94% rename from LPTestTarget/CocoaLumberjack/DDLog+LOGV.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLog+LOGV.h index cf4bfc302..c5810ddd8 100644 --- a/LPTestTarget/CocoaLumberjack/DDLog+LOGV.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLog+LOGV.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -18,7 +18,7 @@ #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import /** * The constant/variable/method responsible for controlling the current log level. @@ -39,15 +39,15 @@ * This big multiline macro makes all the other macros easier to read. **/ #define LOGV_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, avalist) \ - [DDLog log : isAsynchronous \ - level : lvl \ - flag : flg \ - context : ctx \ - file : __FILE__ \ - function : fnct \ - line : __LINE__ \ - tag : atag \ - format : frmt \ + [DDLog log : isAsynchronous \ + level : lvl \ + flag : flg \ + context : ctx \ + file : __FILE__ \ + function : fnct \ + line : __LINE__ \ + tag : atag \ + format : frmt \ args : avalist] /** @@ -80,4 +80,3 @@ #define DDLogVInfo(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) #define DDLogVDebug(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) #define DDLogVVerbose(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) - diff --git a/LPTestTarget/CocoaLumberjack/DDLog.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLog.h similarity index 68% rename from LPTestTarget/CocoaLumberjack/DDLog.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLog.h index b7f107456..decae297b 100644 --- a/LPTestTarget/CocoaLumberjack/DDLog.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLog.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -15,12 +15,22 @@ #import -// Enable 1.9.x legacy macros if imported directly -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 1 +// The Swift Package integration has no support for the legacy macros. +#if __has_include() + // Enable 1.9.x legacy macros if imported directly and it's not a swift package build. + #ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 1 + #endif + // DD_LEGACY_MACROS is checked in the file itself + #import #endif -// DD_LEGACY_MACROS is checked in the file itself -#import "DDLegacyMacros.h" + +#ifndef DD_LEGACY_MESSAGE_TAG + #define DD_LEGACY_MESSAGE_TAG 1 +#endif + +// Names of loggers. +#import #if OS_OBJECT_USE_OBJC #define DISPATCH_QUEUE_REFERENCE_TYPE strong @@ -29,9 +39,12 @@ #endif @class DDLogMessage; +@class DDLoggerInformation; @protocol DDLogger; @protocol DDLogFormatter; +NS_ASSUME_NONNULL_BEGIN + /** * Define the standard options. * @@ -101,27 +114,27 @@ */ typedef NS_OPTIONS(NSUInteger, DDLogFlag){ /** - * 0...00000 DDLogFlagError + * 0...00001 DDLogFlagError */ DDLogFlagError = (1 << 0), - + /** - * 0...00001 DDLogFlagWarning + * 0...00010 DDLogFlagWarning */ DDLogFlagWarning = (1 << 1), - + /** - * 0...00010 DDLogFlagInfo + * 0...00100 DDLogFlagInfo */ DDLogFlagInfo = (1 << 2), - + /** - * 0...00100 DDLogFlagDebug + * 0...01000 DDLogFlagDebug */ DDLogFlagDebug = (1 << 3), - + /** - * 0...01000 DDLogFlagVerbose + * 0...10000 DDLogFlagVerbose */ DDLogFlagVerbose = (1 << 4) }; @@ -134,32 +147,32 @@ typedef NS_ENUM(NSUInteger, DDLogLevel){ * No logs */ DDLogLevelOff = 0, - + /** * Error logs only */ DDLogLevelError = (DDLogFlagError), - + /** * Error and warning logs */ DDLogLevelWarning = (DDLogLevelError | DDLogFlagWarning), - + /** * Error, warning and info logs */ DDLogLevelInfo = (DDLogLevelWarning | DDLogFlagInfo), - + /** * Error, warning, info and debug logs */ DDLogLevelDebug = (DDLogLevelInfo | DDLogFlagDebug), - + /** * Error, warning, info, debug and verbose logs */ DDLogLevelVerbose = (DDLogLevelDebug | DDLogFlagVerbose), - + /** * All logs (1...11111) */ @@ -174,7 +187,7 @@ typedef NS_ENUM(NSUInteger, DDLogLevel){ * * @return the file name */ -NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); +FOUNDATION_EXTERN NSString * __nullable DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); /** * The THIS_FILE macro gives you an NSString of the file name. @@ -194,6 +207,20 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); **/ #define THIS_METHOD NSStringFromSelector(_cmd) +/** + * Makes a declaration "Sendable" in Swift (if supported by the compiler). + */ +#ifndef DD_SENDABLE +#ifdef __has_attribute +#if __has_attribute(swift_attr) +#define DD_SENDABLE __attribute__((swift_attr("@Sendable"))) +#endif +#endif +#endif +#ifndef DD_SENDABLE +#define DD_SENDABLE +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #pragma mark - @@ -203,13 +230,20 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * The main class, exposes all logging mechanisms, loggers, ... * For most of the users, this class is hidden behind the logging functions like `DDLogInfo` */ +DD_SENDABLE @interface DDLog : NSObject +/** + * Returns the singleton `DDLog`. + * The instance is used by `DDLog` class methods. + */ +@property (class, nonatomic, strong, readonly) DDLog *sharedInstance; + /** * Provides access to the underlying logging queue. * This may be helpful to Logger classes for things like thread synchronization. **/ -+ (dispatch_queue_t)loggingQueue; +@property (class, nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggingQueue; /** * Logging Primitive. @@ -232,9 +266,35 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); flag:(DDLogFlag)flag context:(NSInteger)context file:(const char *)file - function:(const char *)function + function:(nullable const char *)function line:(NSUInteger)line - tag:(id)tag + tag:(nullable id)tag + format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10); + +/** + * Logging Primitive. + * + * This method is used by the macros or logging functions. + * It is suggested you stick with the macros as they're easier to use. + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param level the log level + * @param flag the log flag + * @param context the context (if any is defined) + * @param file the current file + * @param function the current function + * @param line the current code line + * @param tag potential tag + * @param format the log format + */ +- (void)log:(BOOL)asynchronous + level:(DDLogLevel)level + flag:(DDLogFlag)flag + context:(NSInteger)context + file:(const char *)file + function:(nullable const char *)function + line:(NSUInteger)line + tag:(nullable id)tag format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10); /** @@ -259,17 +319,19 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); flag:(DDLogFlag)flag context:(NSInteger)context file:(const char *)file - function:(const char *)function + function:(nullable const char *)function line:(NSUInteger)line - tag:(id)tag + tag:(nullable id)tag format:(NSString *)format - args:(va_list)argList; + args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:)); /** - * Logging Primitive. + * Logging Primitive. + * + * This method can be used if you have a prepared va_list. + * Similar to `log:level:flag:context:file:function:line:tag:format:...` * * @param asynchronous YES if the logging is done async, NO if you want to force sync - * @param message the message * @param level the log level * @param flag the log flag * @param context the context (if any is defined) @@ -277,27 +339,41 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * @param function the current function * @param line the current code line * @param tag potential tag + * @param format the log format + * @param argList the arguments list as a va_list */ -+ (void)log:(BOOL)asynchronous - message:(NSString *)message +- (void)log:(BOOL)asynchronous level:(DDLogLevel)level flag:(DDLogFlag)flag context:(NSInteger)context file:(const char *)file - function:(const char *)function + function:(nullable const char *)function line:(NSUInteger)line - tag:(id)tag; + tag:(nullable id)tag + format:(NSString *)format + args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:)); /** * Logging Primitive. * - * This method can be used if you manualy prepared DDLogMessage. + * This method can be used if you manually prepared DDLogMessage. * * @param asynchronous YES if the logging is done async, NO if you want to force sync * @param logMessage the log message stored in a `DDLogMessage` model object */ + (void)log:(BOOL)asynchronous - message:(DDLogMessage *)logMessage; + message:(DDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:)); + +/** + * Logging Primitive. + * + * This method can be used if you manually prepared DDLogMessage. + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param logMessage the log message stored in a `DDLogMessage` model object + */ +- (void)log:(BOOL)asynchronous + message:(DDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:)); /** * Since logging can be asynchronous, there may be times when you want to flush the logs. @@ -305,6 +381,12 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); **/ + (void)flushLog; +/** + * Since logging can be asynchronous, there may be times when you want to flush the logs. + * The framework invokes this automatically when the application quits. + **/ +- (void)flushLog; + /** * Loggers * @@ -322,6 +404,13 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); **/ + (void)addLogger:(id )logger; +/** + * Adds the logger to the system. + * + * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`. + **/ +- (void)addLogger:(id )logger; + /** * Adds the logger to the system. * @@ -360,20 +449,83 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); **/ + (void)addLogger:(id )logger withLevel:(DDLogLevel)level; +/** + * Adds the logger to the system. + * + * The level that you provide here is a preemptive filter (for performance). + * That is, the level specified here will be used to filter out logMessages so that + * the logger is never even invoked for the messages. + * + * More information: + * When you issue a log statement, the logging framework iterates over each logger, + * and checks to see if it should forward the logMessage to the logger. + * This check is done using the level parameter passed to this method. + * + * For example: + * + * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];` + * `[DDLog addLogger:fileLogger withLogLevel:DDLogLevelWarning];` + * + * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger + * `DDLogInfo(@"hi");` => gets forwarded to consoleLogger only + * + * It is important to remember that Lumberjack uses a BITMASK. + * Many developers & third party frameworks may define extra log levels & flags. + * For example: + * + * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000` + * + * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages. + * + * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO` + * + * Consider passing `DDLogLevelAll` to this method, which has all bits set. + * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set, + * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug: + * + * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)` + **/ +- (void)addLogger:(id )logger withLevel:(DDLogLevel)level; + /** * Remove the logger from the system */ + (void)removeLogger:(id )logger; +/** + * Remove the logger from the system + */ +- (void)removeLogger:(id )logger; + /** * Remove all the current loggers */ + (void)removeAllLoggers; +/** + * Remove all the current loggers + */ +- (void)removeAllLoggers; + /** * Return all the current loggers */ -+ (NSArray *)allLoggers; +@property (class, nonatomic, copy, readonly) NSArray> *allLoggers; + +/** + * Return all the current loggers + */ +@property (nonatomic, copy, readonly) NSArray> *allLoggers; + +/** + * Return all the current loggers with their level (aka DDLoggerInformation). + */ +@property (class, nonatomic, copy, readonly) NSArray *allLoggersWithLevel; + +/** + * Return all the current loggers with their level (aka DDLoggerInformation). + */ +@property (nonatomic, copy, readonly) NSArray *allLoggersWithLevel; /** * Registered Dynamic Logging @@ -385,12 +537,12 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); /** * Returns an array with the classes that are using registered dynamic logging */ -+ (NSArray *)registeredClasses; +@property (class, nonatomic, copy, readonly) NSArray *registeredClasses; /** * Returns an array with the classes names that are using registered dynamic logging */ -+ (NSArray *)registeredClassNames; +@property (class, nonatomic, copy, readonly) NSArray *registeredClassNames; /** * Returns the current log level for a certain class @@ -440,7 +592,7 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * * @param logMessage the message (model) */ -- (void)logMessage:(DDLogMessage *)logMessage; +- (void)logMessage:(DDLogMessage *)logMessage NS_SWIFT_NAME(log(message:)); /** * Formatters may optionally be added to any logger. @@ -448,7 +600,7 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * If no formatter is set, the logger simply logs the message as it is given in logMessage, * or it may use its own built in formatting style. **/ -@property (nonatomic, strong) id logFormatter; +@property (nonatomic, strong, nullable) id logFormatter; @optional @@ -466,16 +618,29 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); - (void)didAddLogger; /** - * See the above description for `didAddLoger` + * Since logging is asynchronous, adding and removing loggers is also asynchronous. + * In other words, the loggers are added and removed at appropriate times with regards to log messages. + * + * - Loggers will not receive log messages that were executed prior to when they were added. + * - Loggers will not receive log messages that were executed after they were removed. + * + * These methods are executed in the logging thread/queue given in parameter. + * This is the same thread/queue that will execute every logMessage: invocation. + * Loggers may use the queue parameter to set specific values on the queue with dispatch_set_specific() function. + **/ +- (void)didAddLoggerInQueue:(dispatch_queue_t)queue; + +/** + * See the above description for `didAddLogger` */ - (void)willRemoveLogger; /** * Some loggers may buffer IO for optimization purposes. - * For example, a database logger may only save occasionaly as the disk IO is slow. + * For example, a database logger may only save occasionally as the disk IO is slow. * In such loggers, this method should be implemented to flush any pending IO. * - * This allows invocations of DDLog's flushLog method to be propogated to loggers that need it. + * This allows invocations of DDLog's flushLog method to be propagated to loggers that need it. * * Note that DDLog's flushLog method is invoked automatically when the application quits, * and it may be also invoked manually by the developer prior to application crashes, or other such reasons. @@ -495,7 +660,7 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * The created queue will receive its name from this method. * This may be helpful for debugging or profiling reasons. **/ -@property (nonatomic, readonly) NSString *loggerName; +@property (copy, nonatomic, readonly) DDLoggerName loggerName; @end @@ -520,7 +685,7 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * The formatter may also optionally filter the log message by returning nil, * in which case the logger will not log the message. **/ -- (NSString *)formatLogMessage:(DDLogMessage *)logMessage; +- (nullable NSString *)formatLogMessage:(DDLogMessage *)logMessage NS_SWIFT_NAME(format(message:)); @optional @@ -530,11 +695,23 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * * This is primarily for thread-safety. * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers. - * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter), + * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter with 10.0 behavior), * it could possibly use these hooks to switch to thread-safe versions of the code. **/ - (void)didAddToLogger:(id )logger; +/** + * A single formatter instance can be added to multiple loggers. + * These methods provides hooks to notify the formatter of when it's added/removed. + * + * This is primarily for thread-safety. + * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers. + * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter with 10.0 behavior), + * it could possibly use these hooks to switch to thread-safe versions of the code or use dispatch_set_specific() +.* to add its own specific values. + **/ +- (void)didAddToLogger:(id )logger inQueue:(dispatch_queue_t)queue; + /** * See the above description for `didAddToLogger:` */ @@ -574,12 +751,7 @@ NSString * DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); * } * ``` **/ -+ (DDLogLevel)ddLogLevel; - -/** - * See the above description for `ddLogLevel` - */ -+ (void)ddSetLogLevel:(DDLogLevel)level; +@property (class, nonatomic, readwrite, setter=ddSetLogLevel:) DDLogLevel ddLogLevel; @end @@ -598,17 +770,22 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){ /** * Use this to use a copy of the file path */ - DDLogMessageCopyFile = 1 << 0, + DDLogMessageCopyFile = 1 << 0, /** * Use this to use a copy of the function name */ - DDLogMessageCopyFunction = 1 << 1 + DDLogMessageCopyFunction = 1 << 1, + /** + * Use this to use avoid a copy of the message + */ + DDLogMessageDontCopyMessage = 1 << 2 }; /** * The `DDLogMessage` class encapsulates information about the log message. * If you write custom loggers or formatters, you will be dealing with objects of this class. **/ +DD_SENDABLE @interface DDLogMessage : NSObject { // Direct accessors to be used only for performance @@ -621,18 +798,22 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){ NSString *_fileName; NSString *_function; NSUInteger _line; - id _tag; + #if DD_LEGACY_MESSAGE_TAG + id _tag __attribute__((deprecated("Use _representedObject instead", "_representedObject"))); + #endif + id _representedObject; DDLogMessageOptions _options; - NSDate *_timestamp; + NSDate * _timestamp; NSString *_threadID; NSString *_threadName; NSString *_queueLabel; + NSUInteger _qos; } /** - * Default `init` is not available + * Default `init` for empty messages. */ -- (instancetype)init NS_UNAVAILABLE; +- (instancetype)init NS_DESIGNATED_INITIALIZER; /** * Standard init method for a log message object. @@ -666,11 +847,11 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){ flag:(DDLogFlag)flag context:(NSInteger)context file:(NSString *)file - function:(NSString *)function + function:(nullable NSString *)function line:(NSUInteger)line - tag:(id)tag + tag:(nullable id)tag options:(DDLogMessageOptions)options - timestamp:(NSDate *)timestamp NS_DESIGNATED_INITIALIZER; + timestamp:(nullable NSDate *)timestamp NS_DESIGNATED_INITIALIZER; /** * Read-only properties @@ -685,14 +866,18 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){ @property (readonly, nonatomic) NSInteger context; @property (readonly, nonatomic) NSString *file; @property (readonly, nonatomic) NSString *fileName; -@property (readonly, nonatomic) NSString *function; +@property (readonly, nonatomic, nullable) NSString * function; @property (readonly, nonatomic) NSUInteger line; -@property (readonly, nonatomic) id tag; +#if DD_LEGACY_MESSAGE_TAG +@property (readonly, nonatomic, nullable) id tag __attribute__((deprecated("Use representedObject instead", "representedObject"))); +#endif +@property (readonly, nonatomic, nullable) id representedObject; @property (readonly, nonatomic) DDLogMessageOptions options; @property (readonly, nonatomic) NSDate *timestamp; @property (readonly, nonatomic) NSString *threadID; // ID as it appears in NSLog calculated from the machThreadID -@property (readonly, nonatomic) NSString *threadName; +@property (readonly, nonatomic, nullable) NSString *threadName; @property (readonly, nonatomic) NSString *queueLabel; +@property (readonly, nonatomic) NSUInteger qos API_AVAILABLE(macos(10.10), ios(8.0)); @end @@ -704,10 +889,10 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){ * The `DDLogger` protocol specifies that an optional formatter can be added to a logger. * Most (but not all) loggers will want to support formatters. * - * However, writting getters and setters in a thread safe manner, + * However, writing getters and setters in a thread safe manner, * while still maintaining maximum speed for the logging process, is a difficult task. * - * To do it right, the implementation of the getter/setter has strict requiremenets: + * To do it right, the implementation of the getter/setter has strict requirements: * - Must NOT require the `logMessage:` method to acquire a lock. * - Must NOT require the `logMessage:` method to access an atomic property (also a lock of sorts). * @@ -724,7 +909,7 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){ dispatch_queue_t _loggerQueue; } -@property (nonatomic, strong) id logFormatter; +@property (nonatomic, strong, nullable) id logFormatter; @property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE) dispatch_queue_t loggerQueue; // For thread-safety assertions @@ -741,3 +926,19 @@ typedef NS_OPTIONS(NSInteger, DDLogMessageOptions){ @end +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +DD_SENDABLE +@interface DDLoggerInformation : NSObject + +@property (nonatomic, readonly) id logger; +@property (nonatomic, readonly) DDLogLevel level; + ++ (instancetype)informationWithLogger:(id )logger + andLevel:(DDLogLevel)level; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLogMacros.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLogMacros.h new file mode 100644 index 000000000..4180253ef --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLogMacros.h @@ -0,0 +1,101 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +/** + * The constant/variable/method responsible for controlling the current log level. + **/ +#ifndef LOG_LEVEL_DEF + #define LOG_LEVEL_DEF ddLogLevel +#endif + +/** + * Whether async should be used by log messages, excluding error messages that are always sent sync. + **/ +#ifndef LOG_ASYNC_ENABLED + #define LOG_ASYNC_ENABLED YES +#endif + +/** + * These are the two macros that all other macros below compile into. + * These big multiline macros makes all the other macros easier to read. + **/ +#define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ + [DDLog log : isAsynchronous \ + level : lvl \ + flag : flg \ + context : ctx \ + file : __FILE__ \ + function : fnct \ + line : __LINE__ \ + tag : atag \ + format : (frmt), ## __VA_ARGS__] + +#define LOG_MACRO_TO_DDLOG(ddlog, isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ + [ddlog log : isAsynchronous \ + level : lvl \ + flag : flg \ + context : ctx \ + file : __FILE__ \ + function : fnct \ + line : __LINE__ \ + tag : atag \ + format : (frmt), ## __VA_ARGS__] + +/** + * Define version of the macro that only execute if the log level is above the threshold. + * The compiled versions essentially look like this: + * + * if (logFlagForThisLogMsg & ddLogLevel) { execute log message } + * + * When LOG_LEVEL_DEF is defined as ddLogLevel. + * + * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels. + * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques. + * + * Note that when compiler optimizations are enabled (as they are for your release builds), + * the log messages above your logging threshold will automatically be compiled out. + * + * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see + * if the 'if' statement would execute, and if not it strips it from the binary.) + * + * We also define shorthand versions for asynchronous and synchronous logging. + **/ +#define LOG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \ + do { if((lvl & flg) != 0) LOG_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0) + +#define LOG_MAYBE_TO_DDLOG(ddlog, async, lvl, flg, ctx, tag, fnct, frmt, ...) \ + do { if((lvl & flg) != 0) LOG_MACRO_TO_DDLOG(ddlog, async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0) + +/** + * Ready to use log macros with no context or tag. + **/ +#define DDLogError(frmt, ...) LOG_MAYBE(NO, LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogWarn(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogInfo(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogDebug(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogVerbose(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) + +#define DDLogErrorToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, NO, LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogWarnToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogInfoToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogDebugToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define DDLogVerboseToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLoggerNames.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLoggerNames.h new file mode 100644 index 000000000..d276ee46c --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDLoggerNames.h @@ -0,0 +1,30 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NSString *DDLoggerName NS_EXTENSIBLE_STRING_ENUM; + +FOUNDATION_EXPORT DDLoggerName const DDLoggerNameOS NS_SWIFT_NAME(DDLoggerName.os); // DDOSLogger +FOUNDATION_EXPORT DDLoggerName const DDLoggerNameFile NS_SWIFT_NAME(DDLoggerName.file); // DDFileLogger + +FOUNDATION_EXPORT DDLoggerName const DDLoggerNameTTY NS_SWIFT_NAME(DDLoggerName.tty); // DDTTYLogger + +API_DEPRECATED("Use DDOSLogger instead", macosx(10.4, 10.12), ios(2.0, 10.0), watchos(2.0, 3.0), tvos(9.0, 10.0)) +FOUNDATION_EXPORT DDLoggerName const DDLoggerNameASL NS_SWIFT_NAME(DDLoggerName.asl); // DDASLLogger + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/Extensions/DDMultiFormatter.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDMultiFormatter.h similarity index 74% rename from LPTestTarget/CocoaLumberjack/Extensions/DDMultiFormatter.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDMultiFormatter.h index 1d6ceeabd..40b248dc4 100644 --- a/LPTestTarget/CocoaLumberjack/Extensions/DDMultiFormatter.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDMultiFormatter.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -20,7 +20,9 @@ #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import + +NS_ASSUME_NONNULL_BEGIN /** * This formatter can be used to chain different formatters together. @@ -31,22 +33,22 @@ /** * Array of chained formatters */ -@property (readonly) NSArray *formatters; +@property (nonatomic, readonly) NSArray> *formatters; /** * Add a new formatter */ -- (void)addFormatter:(id)formatter; +- (void)addFormatter:(id)formatter NS_SWIFT_NAME(add(_:)); /** * Remove a formatter */ -- (void)removeFormatter:(id)formatter; +- (void)removeFormatter:(id)formatter NS_SWIFT_NAME(remove(_:)); /** * Remove all existing formatters */ -- (void)removeAllFormatters; +- (void)removeAllFormatters NS_SWIFT_NAME(removeAll()); /** * Check if a certain formatter is used @@ -54,3 +56,5 @@ - (BOOL)isFormattingWithFormatter:(id)formatter; @end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDOSLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDOSLogger.h new file mode 100644 index 000000000..1d947a705 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDOSLogger.h @@ -0,0 +1,56 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a logger for the Apple os_log facility. + **/ +API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0)) +DD_SENDABLE +@interface DDOSLogger : DDAbstractLogger + +/** + * Singleton method + * + * @return the shared instance with OS_LOG_DEFAULT. + */ +@property (nonatomic, class, readonly, strong) DDOSLogger *sharedInstance; + +/** + Designated initializer + + @param subsystem Desired subsystem in log. E.g. "org.example" + @param category Desired category in log. E.g. "Point of interests." + @return New instance of DDOSLogger. + + @discussion This method requires either both or no parameter to be set. Much like `(String, String)?` in Swift. + If both parameters are nil, this method will return a logger configured with `OS_LOG_DEFAULT`. + If both parameters are non-nil, it will return a logger configured with `os_log_create(subsystem, category)` + */ +- (instancetype)initWithSubsystem:(nullable NSString *)subsystem category:(nullable NSString *)category NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LPTestTarget/CocoaLumberjack/DDTTYLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDTTYLogger.h similarity index 79% rename from LPTestTarget/CocoaLumberjack/DDTTYLogger.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDTTYLogger.h index c27415c22..78f621ce8 100644 --- a/LPTestTarget/CocoaLumberjack/DDTTYLogger.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Headers/DDTTYLogger.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -18,30 +18,31 @@ #define DD_LEGACY_MACROS 0 #endif -#import "DDLog.h" +#import #define LOG_CONTEXT_ALL INT_MAX #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" -#if TARGET_OS_IPHONE - // iOS +#if !(TARGET_OS_OSX) + // iOS or tvOS or watchOS #import typedef UIColor DDColor; - static inline DDColor* DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithRed:(r/255.0f) green:(g/255.0f) blue:(b/255.0f) alpha:1.0f];} + static inline DDColor* _Nonnull DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:1.0];} #elif defined(DD_CLI) || !__has_include() // OS X CLI - #import "CLIColor.h" + #import typedef CLIColor DDColor; - static inline DDColor* DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithCalibratedRed:(r/255.0f) green:(g/255.0f) blue:(b/255.0f) alpha:1.0f];} + static inline DDColor* _Nonnull DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithCalibratedRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:1.0];} #else // OS X with AppKit #import typedef NSColor DDColor; - static inline DDColor* DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithCalibratedRed:(r/255.0f) green:(g/255.0f) blue:(b/255.0f) alpha:1.0f];} + static inline DDColor * _Nonnull DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithCalibratedRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:1.0];} #endif #pragma clang diagnostic pop +NS_ASSUME_NONNULL_BEGIN /** * This class provides a logger for Terminal output or Xcode console output, @@ -60,9 +61,9 @@ @interface DDTTYLogger : DDAbstractLogger /** - * Singleton method + * Singleton instance. Returns `nil` if the initialization of the DDTTYLogger fails. */ -+ (instancetype)sharedInstance; +@property (nonatomic, class, readonly, strong, nullable) DDTTYLogger *sharedInstance; /* Inherited from the DDLogger protocol: * @@ -103,6 +104,11 @@ **/ @property (nonatomic, readwrite, assign) BOOL automaticallyAppendNewlineForCustomFormatters; +/** + Using this initializer is not supported. Please use `DDTTYLogger.sharedInstance`. + **/ +- (instancetype)init NS_UNAVAILABLE; + /** * The default color set (foregroundColor, backgroundColor) is: * @@ -125,7 +131,7 @@ * * This method invokes setForegroundColor:backgroundColor:forFlag:context: and applies it to `LOG_CONTEXT_ALL`. **/ -- (void)setForegroundColor:(DDColor *)txtColor backgroundColor:(DDColor *)bgColor forFlag:(DDLogFlag)mask; +- (void)setForegroundColor:(nullable DDColor *)txtColor backgroundColor:(nullable DDColor *)bgColor forFlag:(DDLogFlag)mask; /** * Just like setForegroundColor:backgroundColor:flag, but allows you to specify a particular logging context. @@ -133,12 +139,12 @@ * A logging context is often used to identify log messages coming from a 3rd party framework, * although logging context's can be used for many different functions. * - * Use LOG_CONTEXT_ALL to set the deafult color for all contexts that have no specific color set defined. + * Use LOG_CONTEXT_ALL to set the default color for all contexts that have no specific color set defined. * * Logging context's are explained in further detail here: * Documentation/CustomContext.md **/ -- (void)setForegroundColor:(DDColor *)txtColor backgroundColor:(DDColor *)bgColor forFlag:(DDLogFlag)mask context:(NSInteger)ctxt; +- (void)setForegroundColor:(nullable DDColor *)txtColor backgroundColor:(nullable DDColor *)bgColor forFlag:(DDLogFlag)mask context:(NSInteger)ctxt; /** * Similar to the methods above, but allows you to map DDLogMessage->tag to a particular color profile. @@ -147,7 +153,7 @@ * static NSString *const PurpleTag = @"PurpleTag"; * * #define DDLogPurple(frmt, ...) LOG_OBJC_TAG_MACRO(NO, 0, 0, 0, PurpleTag, frmt, ##__VA_ARGS__) - * + * * And then where you configure CocoaLumberjack: * * purple = DDMakeColor((64/255.0), (0/255.0), (128/255.0)); @@ -163,7 +169,7 @@ * * DDLogPurple(@"I'm a purple log message!"); **/ -- (void)setForegroundColor:(DDColor *)txtColor backgroundColor:(DDColor *)bgColor forTag:(id )tag; +- (void)setForegroundColor:(nullable DDColor *)txtColor backgroundColor:(nullable DDColor *)bgColor forTag:(id )tag; /** * Clearing color profiles. @@ -176,3 +182,5 @@ - (void)clearAllColors; @end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Info.plist b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Info.plist new file mode 100644 index 000000000..39e016957 Binary files /dev/null and b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Info.plist differ diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Modules/module.modulemap b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Modules/module.modulemap new file mode 100644 index 000000000..0afd57a8f --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module CocoaLumberjack { + umbrella header "CocoaLumberjack.h" + + export * + module * { export * } +} diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/PrivateHeaders/DDFileLogger+Internal.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/PrivateHeaders/DDFileLogger+Internal.h new file mode 100644 index 000000000..ef1841640 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/CocoaLumberjack.framework/PrivateHeaders/DDFileLogger+Internal.h @@ -0,0 +1,31 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface DDFileLogger (Internal) + +- (void)logData:(NSData *)data; + +// Will assert if used outside logger's queue. +- (void)lt_logData:(NSData *)data; + +- (nullable NSData *)lt_dataForMessage:(DDLogMessage *)message; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/dSYMs/CocoaLumberjack.framework.dSYM/Contents/Info.plist b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/dSYMs/CocoaLumberjack.framework.dSYM/Contents/Info.plist new file mode 100644 index 000000000..ae54426de --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/dSYMs/CocoaLumberjack.framework.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.com.deusty.CocoaLumberjack + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 3.7.4 + CFBundleVersion + 1 + + diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/dSYMs/CocoaLumberjack.framework.dSYM/Contents/Resources/DWARF/CocoaLumberjack b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/dSYMs/CocoaLumberjack.framework.dSYM/Contents/Resources/DWARF/CocoaLumberjack new file mode 100644 index 000000000..070bd1beb Binary files /dev/null and b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64/dSYMs/CocoaLumberjack.framework.dSYM/Contents/Resources/DWARF/CocoaLumberjack differ diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/CocoaLumberjack b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/CocoaLumberjack new file mode 100755 index 000000000..005df4169 Binary files /dev/null and b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/CocoaLumberjack differ diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/CLIColor.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/CLIColor.h new file mode 100644 index 000000000..e93056623 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/CLIColor.h @@ -0,0 +1,54 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +#if TARGET_OS_OSX + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class represents an NSColor replacement for CLI projects that don't link with AppKit + **/ +@interface CLIColor : NSObject + +/** + * Convenience method for creating a `CLIColor` instance from RGBA params + * + * @param red red channel, between 0 and 1 + * @param green green channel, between 0 and 1 + * @param blue blue channel, between 0 and 1 + * @param alpha alpha channel, between 0 and 1 + */ ++ (instancetype)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; + +/** + * Get the RGBA components from a `CLIColor` + * + * @param red red channel, between 0 and 1 + * @param green green channel, between 0 and 1 + * @param blue blue channel, between 0 and 1 + * @param alpha alpha channel, between 0 and 1 + */ +- (void)getRed:(nullable CGFloat *)red green:(nullable CGFloat *)green blue:(nullable CGFloat *)blue alpha:(nullable CGFloat *)alpha NS_SWIFT_NAME(get(red:green:blue:alpha:)); + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/CocoaLumberjack.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/CocoaLumberjack.h new file mode 100644 index 000000000..8082d6ec4 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/CocoaLumberjack.h @@ -0,0 +1,104 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +/** + * Welcome to CocoaLumberjack! + * + * The project page has a wealth of documentation if you have any questions. + * https://github.com/CocoaLumberjack/CocoaLumberjack + * + * If you're new to the project you may wish to read "Getting Started" at: + * Documentation/GettingStarted.md + * + * Otherwise, here is a quick refresher. + * There are three steps to using the macros: + * + * Step 1: + * Import the header in your implementation or prefix file: + * + * #import + * + * Step 2: + * Define your logging level in your implementation file: + * + * // Log levels: off, error, warn, info, verbose + * static const DDLogLevel ddLogLevel = DDLogLevelVerbose; + * + * Step 2 [3rd party frameworks]: + * + * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: + * + * // #undef LOG_LEVEL_DEF // Undefine first only if needed + * #define LOG_LEVEL_DEF myLibLogLevel + * + * Define your logging level in your implementation file: + * + * // Log levels: off, error, warn, info, verbose + * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose; + * + * Step 3: + * Replace your NSLog statements with DDLog statements according to the severity of the message. + * + * NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!"); + * + * DDLog works exactly the same as NSLog. + * This means you can pass it multiple variables just like NSLog. + **/ + +#import + +//! Project version number for CocoaLumberjack. +FOUNDATION_EXPORT double CocoaLumberjackVersionNumber; + +//! Project version string for CocoaLumberjack. +FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[]; + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +// Core +#import + +// Main macros +#import +#import + +// Capture ASL +#import + +// Loggers +#import + +#import +#import +#import +#import + +// Extensions +#import +#import +#import +#import +#import + +// CLI +#import + +// etc +#import +#import +#import diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDASLLogCapture.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDASLLogCapture.h new file mode 100644 index 000000000..7c5d8e384 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDASLLogCapture.h @@ -0,0 +1,46 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +@protocol DDLogger; + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides the ability to capture the ASL (Apple System Logs) + */ +API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) +@interface DDASLLogCapture : NSObject + +/** + * Start capturing logs + */ ++ (void)start; + +/** + * Stop capturing logs + */ ++ (void)stop; + +/** + * The current capture level. + * @note Default log level: DDLogLevelVerbose (i.e. capture all ASL messages). + */ +@property (class) DDLogLevel captureLevel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/calabash/Classes/CocoaLumberjack/LPASLLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDASLLogger.h similarity index 59% rename from calabash/Classes/CocoaLumberjack/LPASLLogger.h rename to Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDASLLogger.h index ec25779e3..65bae5cc8 100644 --- a/calabash/Classes/CocoaLumberjack/LPASLLogger.h +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDASLLogger.h @@ -1,6 +1,6 @@ // Software License Agreement (BSD License) // -// Copyright (c) 2010-2015, Deusty, LLC +// Copyright (c) 2010-2022, Deusty, LLC // All rights reserved. // // Redistribution and use of this software in source and binary forms, @@ -16,23 +16,25 @@ #import // Disable legacy macros -#ifndef LP_LEGACY_MACROS - #define LP_LEGACY_MACROS 0 +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 #endif -#import "LPLog.h" +#import + +NS_ASSUME_NONNULL_BEGIN // Custom key set on messages sent to ASL -extern const char* const kLPASLKeyLPLog; +extern const char* const kDDASLKeyDDLog; -// Value set for kLPASLKeyLPLog -extern const char* const kLPASLLPLogValue; +// Value set for kDDASLKeyDDLog +extern const char* const kDDASLDDLogValue; /** * This class provides a logger for the Apple System Log facility. * * As described in the "Getting Started" page, - * the traditional NSLog() function directs it's output to two places: + * the traditional NSLog() function directs its output to two places: * * - Apple System Log * - StdErr (if stderr is a TTY) so log statements show up in Xcode console @@ -41,14 +43,21 @@ extern const char* const kLPASLLPLogValue; * However, if you instead choose to use file logging (for faster performance), * you may choose to use a file logger and a tty logger. **/ +API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) +@interface DDASLLogger : DDAbstractLogger -@interface LPASLLogger : LPAbstractLogger - -+ (instancetype)sharedInstance; +/** + * Singleton method + * + * @return the shared instance + */ +@property (nonatomic, class, readonly, strong) DDASLLogger *sharedInstance; -// Inherited from LPAbstractLogger +// Inherited from DDAbstractLogger -// - (id )logFormatter; -// - (void)setLogFormatter:(id )formatter; +// - (id )logFormatter; +// - (void)setLogFormatter:(id )formatter; @end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h new file mode 100644 index 000000000..281690e49 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h @@ -0,0 +1,127 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides an abstract implementation of a database logger. + * + * That is, it provides the base implementation for a database logger to build atop of. + * All that is needed for a concrete database logger is to extend this class + * and override the methods in the implementation file that are prefixed with "db_". + **/ +@interface DDAbstractDatabaseLogger : DDAbstractLogger { + +@protected + NSUInteger _saveThreshold; + NSTimeInterval _saveInterval; + NSTimeInterval _maxAge; + NSTimeInterval _deleteInterval; + BOOL _deleteOnEverySave; + + NSInteger _saveTimerSuspended; + NSUInteger _unsavedCount; + dispatch_time_t _unsavedTime; + dispatch_source_t _saveTimer; + dispatch_time_t _lastDeleteTime; + dispatch_source_t _deleteTimer; +} + +/** + * Specifies how often to save the data to disk. + * Since saving is an expensive operation (disk io) it is not done after every log statement. + * These properties allow you to configure how/when the logger saves to disk. + * + * A save is done when either (whichever happens first): + * + * - The number of unsaved log entries reaches saveThreshold + * - The amount of time since the oldest unsaved log entry was created reaches saveInterval + * + * You can optionally disable the saveThreshold by setting it to zero. + * If you disable the saveThreshold you are entirely dependent on the saveInterval. + * + * You can optionally disable the saveInterval by setting it to zero (or a negative value). + * If you disable the saveInterval you are entirely dependent on the saveThreshold. + * + * It's not wise to disable both saveThreshold and saveInterval. + * + * The default saveThreshold is 500. + * The default saveInterval is 60 seconds. + **/ +@property (assign, readwrite) NSUInteger saveThreshold; + +/** + * See the description for the `saveThreshold` property + */ +@property (assign, readwrite) NSTimeInterval saveInterval; + +/** + * It is likely you don't want the log entries to persist forever. + * Doing so would allow the database to grow infinitely large over time. + * + * The maxAge property provides a way to specify how old a log statement can get + * before it should get deleted from the database. + * + * The deleteInterval specifies how often to sweep for old log entries. + * Since deleting is an expensive operation (disk io) is is done on a fixed interval. + * + * An alternative to the deleteInterval is the deleteOnEverySave option. + * This specifies that old log entries should be deleted during every save operation. + * + * You can optionally disable the maxAge by setting it to zero (or a negative value). + * If you disable the maxAge then old log statements are not deleted. + * + * You can optionally disable the deleteInterval by setting it to zero (or a negative value). + * + * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. + * + * It's not wise to enable both deleteInterval and deleteOnEverySave. + * + * The default maxAge is 7 days. + * The default deleteInterval is 5 minutes. + * The default deleteOnEverySave is NO. + **/ +@property (assign, readwrite) NSTimeInterval maxAge; + +/** + * See the description for the `maxAge` property + */ +@property (assign, readwrite) NSTimeInterval deleteInterval; + +/** + * See the description for the `maxAge` property + */ +@property (assign, readwrite) BOOL deleteOnEverySave; + +/** + * Forces a save of any pending log entries (flushes log entries to disk). + **/ +- (void)savePendingLogEntries; + +/** + * Removes any log entries that are older than maxAge. + **/ +- (void)deleteOldLogEntries; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDAssertMacros.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDAssertMacros.h new file mode 100644 index 000000000..f4b7d58ff --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDAssertMacros.h @@ -0,0 +1,30 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +/** + * NSAssert replacement that will output a log message even when assertions are disabled. + **/ +#define DDAssert(condition, frmt, ...) \ + if (!(condition)) { \ + NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ + DDLogError(@"%@", description); \ + NSAssert(NO, @"%@", description); \ + } +#define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition) + +/** + * Analog to `DDAssertionFailure` from DDAssert.swift for use in Objective C + */ +#define DDAssertionFailure(frmt, ...) DDAssert(NO, frmt, ##__VA_ARGS__) diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter+Deprecated.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter+Deprecated.h new file mode 100644 index 000000000..3dcc6af32 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter+Deprecated.h @@ -0,0 +1,119 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a log formatter that filters log statements from a logging context not on the whitelist. + * @deprecated Use DDContextAllowlistFilterLogFormatter instead. + * + * A log formatter can be added to any logger to format and/or filter its output. + * You can learn more about log formatters here: + * Documentation/CustomFormatters.md + * + * You can learn more about logging context's here: + * Documentation/CustomContext.md + * + * But here's a quick overview / refresher: + * + * Every log statement has a logging context. + * These come from the underlying logging macros defined in DDLog.h. + * The default logging context is zero. + * You can define multiple logging context's for use in your application. + * For example, logically separate parts of your app each have a different logging context. + * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. + **/ +__attribute__((deprecated("Use DDContextAllowlistFilterLogFormatter instead"))) +typedef DDContextAllowlistFilterLogFormatter DDContextWhitelistFilterLogFormatter; + +@interface DDContextAllowlistFilterLogFormatter (Deprecated) + +/** + * Add a context to the whitelist + * @deprecated Use -addToAllowlist: instead. + * + * @param loggingContext the context + */ +- (void)addToWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -addToAllowlist: instead"))); + +/** + * Remove context from whitelist + * @deprecated Use -removeFromAllowlist: instead. + * + * @param loggingContext the context + */ +- (void)removeFromWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -removeFromAllowlist: instead"))); + +/** + * Return the whitelist + * @deprecated Use allowlist instead. + */ +@property (nonatomic, readonly, copy) NSArray *whitelist __attribute__((deprecated("Use allowlist instead"))); + +/** + * Check if a context is on the whitelist + * @deprecated Use -isOnAllowlist: instead. + * + * @param loggingContext the context + */ +- (BOOL)isOnWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -isOnAllowlist: instead"))); + +@end + + +/** + * This class provides a log formatter that filters log statements from a logging context on the blacklist. + * @deprecated Use DDContextDenylistFilterLogFormatter instead. + **/ +__attribute__((deprecated("Use DDContextDenylistFilterLogFormatter instead"))) +typedef DDContextDenylistFilterLogFormatter DDContextBlacklistFilterLogFormatter; + +@interface DDContextDenylistFilterLogFormatter (Deprecated) + +/** + * Add a context to the blacklist + * @deprecated Use -addToDenylist: instead. + * + * @param loggingContext the context + */ +- (void)addToBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -addToDenylist: instead"))); + +/** + * Remove context from blacklist + * @deprecated Use -removeFromDenylist: instead. + * + * @param loggingContext the context + */ +- (void)removeFromBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -removeFromDenylist: instead"))); + +/** + * Return the blacklist + * @deprecated Use denylist instead. + */ +@property (readonly, copy) NSArray *blacklist __attribute__((deprecated("Use denylist instead"))); + +/** + * Check if a context is on the blacklist + * @deprecated Use -isOnDenylist: instead. + * + * @param loggingContext the context + */ +- (BOOL)isOnBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -isOnDenylist: instead"))); + +@end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h new file mode 100644 index 000000000..61d37aa8f --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h @@ -0,0 +1,117 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a log formatter that filters log statements from a logging context not on the allowlist. + * + * A log formatter can be added to any logger to format and/or filter its output. + * You can learn more about log formatters here: + * Documentation/CustomFormatters.md + * + * You can learn more about logging context's here: + * Documentation/CustomContext.md + * + * But here's a quick overview / refresher: + * + * Every log statement has a logging context. + * These come from the underlying logging macros defined in DDLog.h. + * The default logging context is zero. + * You can define multiple logging context's for use in your application. + * For example, logically separate parts of your app each have a different logging context. + * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. + **/ +@interface DDContextAllowlistFilterLogFormatter : NSObject + +/** + * Designated default initializer + */ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Add a context to the allowlist + * + * @param loggingContext the context + */ +- (void)addToAllowlist:(NSInteger)loggingContext; + +/** + * Remove context from allowlist + * + * @param loggingContext the context + */ +- (void)removeFromAllowlist:(NSInteger)loggingContext; + +/** + * Return the allowlist + */ +@property (nonatomic, readonly, copy) NSArray *allowlist; + +/** + * Check if a context is on the allowlist + * + * @param loggingContext the context + */ +- (BOOL)isOnAllowlist:(NSInteger)loggingContext; + +@end + + +/** + * This class provides a log formatter that filters log statements from a logging context on the denylist. + **/ +@interface DDContextDenylistFilterLogFormatter : NSObject + +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Add a context to the denylist + * + * @param loggingContext the context + */ +- (void)addToDenylist:(NSInteger)loggingContext; + +/** + * Remove context from denylist + * + * @param loggingContext the context + */ +- (void)removeFromDenylist:(NSInteger)loggingContext; + +/** + * Return the denylist + */ +@property (readonly, copy) NSArray *denylist; + +/** + * Check if a context is on the denylist + * + * @param loggingContext the context + */ +- (BOOL)isOnDenylist:(NSInteger)loggingContext; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h new file mode 100644 index 000000000..618cc08eb --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h @@ -0,0 +1,223 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Log formatter mode + */ +__attribute__((deprecated("DDDispatchQueueLogFormatter is always shareable"))) +typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ + /** + * This is the default option, means the formatter can be reused between multiple loggers and therefore is thread-safe. + * There is, of course, a performance cost for the thread-safety + */ + DDDispatchQueueLogFormatterModeShareble = 0, + /** + * If the formatter will only be used by a single logger, then the thread-safety can be removed + * @note: there is an assert checking if the formatter is added to multiple loggers and the mode is non-shareble + */ + DDDispatchQueueLogFormatterModeNonShareble, +}; + +/** + * Quality of Service names. + * + * Since macOS 10.10 and iOS 8.0, pthreads, dispatch queues and NSOperations express their + * scheduling priority by using an abstract classification called Quality of Service (QOS). + * + * This formatter will add a representation of this QOS in the log message by using those + * string constants. + * For example: + * + * `2011-10-17 20:21:45.435 AppName[19928:5207 (QOS:DF)] Your log message here` + * + * Where QOS is one of: + * `- UI = User Interactive` + * `- IN = User Initiated` + * `- DF = Default` + * `- UT = Utility` + * `- BG = Background` + * `- UN = Unspecified` + * + * Note: QOS will be absent in the log messages if running on OS versions that don't support it. + **/ +typedef NSString * DDQualityOfServiceName NS_STRING_ENUM; + +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUserInteractive NS_SWIFT_NAME(DDQualityOfServiceName.userInteractive) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUserInitiated NS_SWIFT_NAME(DDQualityOfServiceName.userInitiated) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceDefault NS_SWIFT_NAME(DDQualityOfServiceName.default) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUtility NS_SWIFT_NAME(DDQualityOfServiceName.utility) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceBackground NS_SWIFT_NAME(DDQualityOfServiceName.background) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUnspecified NS_SWIFT_NAME(DDQualityOfServiceName.unspecified) API_AVAILABLE(macos(10.10), ios(8.0)); + +/** + * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id. + * + * A log formatter can be added to any logger to format and/or filter its output. + * You can learn more about log formatters here: + * Documentation/CustomFormatters.md + * + * A typical `NSLog` (or `DDTTYLogger`) prints detailed info as `[:]`. + * For example: + * + * `2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here` + * + * Where: + * `- 19928 = process id` + * `- 5207 = thread id (mach_thread_id printed in hex)` + * + * When using grand central dispatch (GCD), this information is less useful. + * This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool. + * For example: + * + * `2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue` + * + * This formatter allows you to replace the standard `[box:info]` with the dispatch_queue name. + * For example: + * + * `2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue` + * + * If the dispatch_queue doesn't have a set name, then it falls back to the thread name. + * If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal). + * + * Note: If manually creating your own background threads (via `NSThread/alloc/init` or `NSThread/detachNeThread`), + * you can use `[[NSThread currentThread] setName:(NSString *)]`. + **/ +@interface DDDispatchQueueLogFormatter : NSObject + +/** + * Standard init method. + * Configure using properties as desired. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializer with ability to set the queue mode + * + * @param mode choose between DDDispatchQueueLogFormatterModeShareble and DDDispatchQueueLogFormatterModeNonShareble, depending if the formatter is shared between several loggers or not + */ +- (instancetype)initWithMode:(DDDispatchQueueLogFormatterMode)mode __attribute__((deprecated("DDDispatchQueueLogFormatter is always shareable"))); + +/** + * The minQueueLength restricts the minimum size of the [detail box]. + * If the minQueueLength is set to 0, there is no restriction. + * + * For example, say a dispatch_queue has a label of "diskIO": + * + * If the minQueueLength is 0: [diskIO] + * If the minQueueLength is 4: [diskIO] + * If the minQueueLength is 5: [diskIO] + * If the minQueueLength is 6: [diskIO] + * If the minQueueLength is 7: [diskIO ] + * If the minQueueLength is 8: [diskIO ] + * + * The default minQueueLength is 0 (no minimum, so [detail box] won't be padded). + * + * If you want every [detail box] to have the exact same width, + * set both minQueueLength and maxQueueLength to the same value. + **/ +@property (assign, atomic) NSUInteger minQueueLength; + +/** + * The maxQueueLength restricts the number of characters that will be inside the [detail box]. + * If the maxQueueLength is 0, there is no restriction. + * + * For example, say a dispatch_queue has a label of "diskIO": + * + * If the maxQueueLength is 0: [diskIO] + * If the maxQueueLength is 4: [disk] + * If the maxQueueLength is 5: [diskI] + * If the maxQueueLength is 6: [diskIO] + * If the maxQueueLength is 7: [diskIO] + * If the maxQueueLength is 8: [diskIO] + * + * The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated). + * + * If you want every [detail box] to have the exact same width, + * set both minQueueLength and maxQueueLength to the same value. + **/ +@property (assign, atomic) NSUInteger maxQueueLength; + +/** + * Sometimes queue labels have long names like "com.apple.main-queue", + * but you'd prefer something shorter like simply "main". + * + * This method allows you to set such preferred replacements. + * The above example is set by default. + * + * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter. + **/ +- (nullable NSString *)replacementStringForQueueLabel:(NSString *)longLabel; + +/** + * See the `replacementStringForQueueLabel:` description + */ +- (void)setReplacementString:(nullable NSString *)shortLabel forQueueLabel:(NSString *)longLabel; + +@end + +/** + * Category on `DDDispatchQueueLogFormatter` to make method declarations easier to extend/modify + **/ +@interface DDDispatchQueueLogFormatter (OverridableMethods) + +/** + * Date formatter default configuration + */ +- (void)configureDateFormatter:(NSDateFormatter *)dateFormatter; + +/** + * Formatter method to transfrom from date to string + */ +- (NSString *)stringFromDate:(NSDate *)date; + +/** + * Method to compute the queue thread label + */ +- (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage; + +@end + +#pragma mark - DDAtomicCountable + +__attribute__((deprecated("DDAtomicCountable is useless since DDDispatchQueueLogFormatter is always shareable now"))) +@protocol DDAtomicCountable + +- (instancetype)initWithDefaultValue:(int32_t)defaultValue; +- (int32_t)increment; +- (int32_t)decrement; +- (int32_t)value; + +@end + +__attribute__((deprecated("DDAtomicCountable is deprecated"))) +@interface DDAtomicCounter: NSObject +@end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDFileLogger+Buffering.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDFileLogger+Buffering.h new file mode 100644 index 000000000..f4cfcfcf3 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDFileLogger+Buffering.h @@ -0,0 +1,27 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface DDFileLogger (Buffering) + +- (instancetype)wrapWithBuffer; +- (instancetype)unwrapFromBuffer; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDFileLogger.h b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDFileLogger.h new file mode 100644 index 000000000..e18973ba5 --- /dev/null +++ b/Carthage/Build/CocoaLumberjack.xcframework/ios-arm64_x86_64-simulator/CocoaLumberjack.framework/Headers/DDFileLogger.h @@ -0,0 +1,532 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +@class DDLogFileInfo; + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a logger to write log statements to a file. + **/ + + +// Default configuration and safety/sanity values. +// +// maximumFileSize -> kDDDefaultLogMaxFileSize +// rollingFrequency -> kDDDefaultLogRollingFrequency +// maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles +// logFilesDiskQuota -> kDDDefaultLogFilesDiskQuota +// +// You should carefully consider the proper configuration values for your application. + +extern unsigned long long const kDDDefaultLogMaxFileSize; +extern NSTimeInterval const kDDDefaultLogRollingFrequency; +extern NSUInteger const kDDDefaultLogMaxNumLogFiles; +extern unsigned long long const kDDDefaultLogFilesDiskQuota; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * The LogFileManager protocol is designed to allow you to control all aspects of your log files. + * + * The primary purpose of this is to allow you to do something with the log files after they have been rolled. + * Perhaps you want to compress them to save disk space. + * Perhaps you want to upload them to an FTP server. + * Perhaps you want to run some analytics on the file. + * + * A default LogFileManager is, of course, provided. + * The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property. + * + * This protocol provides various methods to fetch the list of log files. + * + * There are two variants: sorted and unsorted. + * If sorting is not necessary, the unsorted variant is obviously faster. + * The sorted variant will return an array sorted by when the log files were created, + * with the most recently created log file at index 0, and the oldest log file at the end of the array. + * + * You can fetch only the log file paths (full path including name), log file names (name only), + * or an array of `DDLogFileInfo` objects. + * The `DDLogFileInfo` class is documented below, and provides a handy wrapper that + * gives you easy access to various file attributes such as the creation date or the file size. + */ +@protocol DDLogFileManager +@required + +// Public properties + +/** + * The maximum number of archived log files to keep on disk. + * For example, if this property is set to 3, + * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk. + * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted. + * + * You may optionally disable this option by setting it to zero. + **/ +@property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles; + +/** + * The maximum space that logs can take. On rolling logfile all old log files that exceed logFilesDiskQuota will + * be deleted. + * + * You may optionally disable this option by setting it to zero. + **/ +@property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota; + +// Public methods + +/** + * Returns the logs directory (path) + */ +@property (nonatomic, readonly, copy) NSString *logsDirectory; + +/** + * Returns an array of `NSString` objects, + * each of which is the filePath to an existing log file on disk. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFilePaths; + +/** + * Returns an array of `NSString` objects, + * each of which is the fileName of an existing log file on disk. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileNames; + +/** + * Returns an array of `DDLogFileInfo` objects, + * each representing an existing log file on disk, + * and containing important information about the log file such as it's modification date and size. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileInfos; + +/** + * Just like the `unsortedLogFilePaths` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFilePaths; + +/** + * Just like the `unsortedLogFileNames` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFileNames; + +/** + * Just like the `unsortedLogFileInfos` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFileInfos; + +// Private methods (only to be used by DDFileLogger) + +/** + * Generates a new unique log file path, and creates the corresponding log file. + * This method is executed directly on the file logger's internal queue. + * The file has to exist by the time the method returns. + **/ +- (nullable NSString *)createNewLogFileWithError:(NSError **)error; + +@optional + +// Private methods (only to be used by DDFileLogger) +/** + * Creates a new log file ignoring any errors. Deprecated in favor of `-createNewLogFileWithError:`. + * Will only be called if `-createNewLogFileWithError:` is not implemented. + **/ +- (nullable NSString *)createNewLogFile __attribute__((deprecated("Use -createNewLogFileWithError:"))) NS_SWIFT_UNAVAILABLE("Use -createNewLogFileWithError:"); + +// Notifications from DDFileLogger + +/// Called when a log file was archived. Executed on global queue with default priority. +/// @param logFilePath The path to the log file that was archived. +/// @param wasRolled Whether or not the archiving happend after rolling the log file. +- (void)didArchiveLogFile:(NSString *)logFilePath wasRolled:(BOOL)wasRolled NS_SWIFT_NAME(didArchiveLogFile(atPath:wasRolled:)); + +// Deprecated APIs +/** + * Called when a log file was archived. Executed on global queue with default priority. + */ +- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:)) __attribute__((deprecated("Use -didArchiveLogFile:wasRolled:"))); + +/** + * Called when the roll action was executed and the log was archived. + * Executed on global queue with default priority. + */ +- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:)) __attribute__((deprecated("Use -didArchiveLogFile:wasRolled:"))); + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * Default log file manager. + * + * All log files are placed inside the logsDirectory. + * If a specific logsDirectory isn't specified, the default directory is used. + * On Mac, this is in `~/Library/Logs/`. + * On iPhone, this is in `~/Library/Caches/Logs`. + * + * Log files are named `"