diff --git a/ios/CocoaLumberjack.framework/CocoaLumberjack b/ios/CocoaLumberjack.framework/CocoaLumberjack deleted file mode 100755 index 3673122..0000000 Binary files a/ios/CocoaLumberjack.framework/CocoaLumberjack and /dev/null differ diff --git a/ios/CocoaLumberjack.framework/Headers/CocoaLumberjack.h b/ios/CocoaLumberjack.framework/Headers/CocoaLumberjack.h deleted file mode 100644 index fe5202f..0000000 --- a/ios/CocoaLumberjack.framework/Headers/CocoaLumberjack.h +++ /dev/null @@ -1,81 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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 - -// Disable legacy macros -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 0 -#endif - -// Core -#import "DDLog.h" - -// Main macros -#import "DDLogMacros.h" -#import "DDAssertMacros.h" - -// Capture ASL -#import "DDASLLogCapture.h" - -// Loggers -#import "DDTTYLogger.h" -#import "DDASLLogger.h" -#import "DDFileLogger.h" - diff --git a/ios/CocoaLumberjack.framework/Headers/DDASLLogCapture.h b/ios/CocoaLumberjack.framework/Headers/DDASLLogCapture.h deleted file mode 100644 index e3d0f02..0000000 --- a/ios/CocoaLumberjack.framework/Headers/DDASLLogCapture.h +++ /dev/null @@ -1,48 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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 "DDASLLogger.h" - -@protocol DDLogger; - -/** - * This class provides the ability to capture the ASL (Apple System Logs) - */ -@interface DDASLLogCapture : NSObject - -/** - * Start capturing logs - */ -+ (void)start; - -/** - * Stop capturing logs - */ -+ (void)stop; - -/** - * Returns 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; - -@end diff --git a/ios/CocoaLumberjack.framework/Headers/DDASLLogger.h b/ios/CocoaLumberjack.framework/Headers/DDASLLogger.h deleted file mode 100644 index 6f6fce1..0000000 --- a/ios/CocoaLumberjack.framework/Headers/DDASLLogger.h +++ /dev/null @@ -1,58 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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 "DDLog.h" - -// Custom key set on messages sent to ASL -extern const char* const kDDASLKeyDDLog; - -// 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 its output to two places: - * - * - Apple System Log - * - StdErr (if stderr is a TTY) so log statements show up in Xcode console - * - * To duplicate NSLog() functionality you can simply add this logger and a tty logger. - * However, if you instead choose to use file logging (for faster performance), - * you may choose to use a file logger and a tty logger. - **/ -@interface DDASLLogger : DDAbstractLogger - -/** - * Singleton method - * - * @return the shared instance - */ -+ (instancetype)sharedInstance; - -// Inherited from DDAbstractLogger - -// - (id )logFormatter; -// - (void)setLogFormatter:(id )formatter; - -@end diff --git a/ios/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h b/ios/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h deleted file mode 100644 index 208bb22..0000000 --- a/ios/CocoaLumberjack.framework/Headers/DDAbstractDatabaseLogger.h +++ /dev/null @@ -1,123 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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 "DDLog.h" - -/** - * 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; - - BOOL _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 diff --git a/ios/CocoaLumberjack.framework/Headers/DDAssertMacros.h b/ios/CocoaLumberjack.framework/Headers/DDAssertMacros.h deleted file mode 100644 index 7678a9c..0000000 --- a/ios/CocoaLumberjack.framework/Headers/DDAssertMacros.h +++ /dev/null @@ -1,26 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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. - -/** - * NSAsset 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) - diff --git a/ios/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h b/ios/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h deleted file mode 100644 index 2b47de3..0000000 --- a/ios/CocoaLumberjack.framework/Headers/DDContextFilterLogFormatter.h +++ /dev/null @@ -1,117 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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 "DDLog.h" - -/** - * This class provides a log formatter that filters log statements from a logging context not on the whitelist. - * - * 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 DDContextWhitelistFilterLogFormatter : NSObject - -/** - * Designated default initializer - */ -- (instancetype)init NS_DESIGNATED_INITIALIZER; - -/** - * Add a context to the whitelist - * - * @param loggingContext the context - */ -- (void)addToWhitelist:(NSUInteger)loggingContext; - -/** - * Remove context from whitelist - * - * @param loggingContext the context - */ -- (void)removeFromWhitelist:(NSUInteger)loggingContext; - -/** - * Return the whitelist - */ -@property (readonly, copy) NSArray *whitelist; - -/** - * Check if a context is on the whitelist - * - * @param loggingContext the context - */ -- (BOOL)isOnWhitelist:(NSUInteger)loggingContext; - -@end - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * This class provides a log formatter that filters log statements from a logging context on the blacklist. - **/ -@interface DDContextBlacklistFilterLogFormatter : NSObject - -- (instancetype)init NS_DESIGNATED_INITIALIZER; - -/** - * Add a context to the blacklist - * - * @param loggingContext the context - */ -- (void)addToBlacklist:(NSUInteger)loggingContext; - -/** - * Remove context from blacklist - * - * @param loggingContext the context - */ -- (void)removeFromBlacklist:(NSUInteger)loggingContext; - -/** - * Return the blacklist - */ -@property (readonly, copy) NSArray *blacklist; - - -/** - * Check if a context is on the blacklist - * - * @param loggingContext the context - */ -- (BOOL)isOnBlacklist:(NSUInteger)loggingContext; - -@end diff --git a/ios/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h b/ios/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h deleted file mode 100644 index 527c30f..0000000 --- a/ios/CocoaLumberjack.framework/Headers/DDDispatchQueueLogFormatter.h +++ /dev/null @@ -1,178 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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 -#import - -// Disable legacy macros -#ifndef DD_LEGACY_MACROS - #define DD_LEGACY_MACROS 0 -#endif - -#import "DDLog.h" - -/** - * Log formatter mode - */ -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, -}; - - -/** - * 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; - -/** - * 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. - **/ -- (NSString *)replacementStringForQueueLabel:(NSString *)longLabel; - -/** - * See the `replacementStringForQueueLabel:` description - */ -- (void)setReplacementString:(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; - -/** - * The actual method that formats a message (transforms a `DDLogMessage` model into a printable string) - */ -- (NSString *)formatLogMessage:(DDLogMessage *)logMessage; - -@end diff --git a/ios/CocoaLumberjack.framework/Headers/DDFileLogger.h b/ios/CocoaLumberjack.framework/Headers/DDFileLogger.h deleted file mode 100644 index 5d2081c..0000000 --- a/ios/CocoaLumberjack.framework/Headers/DDFileLogger.h +++ /dev/null @@ -1,492 +0,0 @@ -// Software License Agreement (BSD License) -// -// Copyright (c) 2010-2016, 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 "DDLog.h" - -@class DDLogFileInfo; - -/** - * 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; - -// Salesforce: flag to allow background access to the log file -extern BOOL DDFileLoggerAllowBackgroundAccess; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#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 logfiles 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) - */ -- (NSString *)logsDirectory; - -/** - * Returns an array of `NSString` objects, - * each of which is the filePath to an existing log file on disk. - **/ -- (NSArray *)unsortedLogFilePaths; - -/** - * Returns an array of `NSString` objects, - * each of which is the fileName of an existing log file on disk. - **/ -- (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; - -/** - * 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; - -/** - * 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; - -/** - * 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; - -// Private methods (only to be used by DDFileLogger) - -/** - * Generates a new unique log file path, and creates the corresponding log file. - **/ -- (NSString *)createNewLogFile; - -@optional - -// Notifications from DDFileLogger - -/** - * Called when a log file was archieved - */ -- (void)didArchiveLogFile:(NSString *)logFilePath; - -/** - * Called when the roll action was executed and the log was archieved - */ -- (void)didRollAndArchiveLogFile:(NSString *)logFilePath; - -@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 `"