vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h in motion-yapper-0.0.1 vs vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h in motion-yapper-0.0.2

- old
+ new

@@ -1,22 +1,26 @@ #import <Foundation/Foundation.h> #if TARGET_OS_IPHONE -#import <UIKit/UIColor.h> +#import <UIKit/UIColor.h> // iOS +#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI) +#import <AppKit/NSColor.h> // OS X with AppKit #else -#import <AppKit/NSColor.h> +#import "CLIColor.h" // OS X without AppKit #endif #import "DDLog.h" +#define LOG_CONTEXT_ALL INT_MAX + /** * Welcome to Cocoa Lumberjack! * * The project page has a wealth of documentation if you have any questions. - * https://github.com/robbiehanson/CocoaLumberjack + * https://github.com/CocoaLumberjack/CocoaLumberjack * * If you're new to the project you may wish to read the "Getting Started" wiki. - * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted + * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted * * * This class provides a logger for Terminal output or Xcode console output, * depending on where you are running your code. * @@ -31,37 +35,37 @@ * you may choose to use only a file logger and a tty logger. **/ @interface DDTTYLogger : DDAbstractLogger <DDLogger> { - NSCalendar *calendar; - NSUInteger calendarUnitFlags; - - NSString *appName; - char *app; - size_t appLen; - - NSString *processID; - char *pid; - size_t pidLen; - - BOOL colorsEnabled; - NSMutableArray *colorProfilesArray; - NSMutableDictionary *colorProfilesDict; + NSCalendar *calendar; + NSUInteger calendarUnitFlags; + + NSString *appName; + char *app; + size_t appLen; + + NSString *processID; + char *pid; + size_t pidLen; + + BOOL colorsEnabled; + NSMutableArray *colorProfilesArray; + NSMutableDictionary *colorProfilesDict; } -+ (DDTTYLogger *)sharedInstance; ++ (instancetype)sharedInstance; /* Inherited from the DDLogger protocol: * * Formatters may optionally be added to any logger. * * 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. * * More information about formatters can be found here: - * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters + * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters * * The actual implementation of these methods is inherited from DDAbstractLogger. - (id <DDLogFormatter>)logFormatter; - (void)setLogFormatter:(id <DDLogFormatter>)formatter; @@ -101,31 +105,37 @@ * If you run the application within Xcode, then the XcodeColors plugin is required. * * If you run the application from a shell, then DDTTYLogger will automatically map the given color to * the closest available color. (xterm-256color or xterm-color which have 256 and 16 supported colors respectively.) * - * This method invokes setForegroundColor:backgroundColor:forFlag:context: and passes the default context (0). + * This method invokes setForegroundColor:backgroundColor:forFlag:context: and applies it to `LOG_CONTEXT_ALL`. **/ #if TARGET_OS_IPHONE - (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forFlag:(int)mask; -#else +#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI) - (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forFlag:(int)mask; +#else +- (void)setForegroundColor:(CLIColor *)txtColor backgroundColor:(CLIColor *)bgColor forFlag:(int)mask; #endif /** * Just like setForegroundColor:backgroundColor:flag, but allows you to specify a particular logging context. * * 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. + * * Logging context's are explained in further detail here: - * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomContext + * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomContext **/ #if TARGET_OS_IPHONE - (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forFlag:(int)mask context:(int)ctxt; -#else +#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI) - (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forFlag:(int)mask context:(int)ctxt; +#else +- (void)setForegroundColor:(CLIColor *)txtColor backgroundColor:(CLIColor *)bgColor forFlag:(int)mask context:(int)ctxt; #endif /** * Similar to the methods above, but allows you to map DDLogMessage->tag to a particular color profile. * For example, you could do something like this: @@ -138,21 +148,25 @@ * * #if TARGET_OS_IPHONE * UIColor *purple = [UIColor colorWithRed:(64/255.0) green:(0/255.0) blue:(128/255.0) alpha:1.0]; * #else * NSColor *purple = [NSColor colorWithCalibratedRed:(64/255.0) green:(0/255.0) blue:(128/255.0) alpha:1.0]; + * + * Note: For CLI OS X projects that don't link with AppKit use CLIColor objects instead * * [[DDTTYLogger sharedInstance] setForegroundColor:purple backgroundColor:nil forTag:PurpleTag]; * [DDLog addLogger:[DDTTYLogger sharedInstance]]; * * This would essentially give you a straight NSLog replacement that prints in purple: * * DDLogPurple(@"I'm a purple log message!"); **/ #if TARGET_OS_IPHONE - (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forTag:(id <NSCopying>)tag; -#else +#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI) - (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forTag:(id <NSCopying>)tag; +#else +- (void)setForegroundColor:(CLIColor *)txtColor backgroundColor:(CLIColor *)bgColor forTag:(id <NSCopying>)tag; #endif /** * Clearing color profiles. **/