Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (51 sloc) 1.869 kB
#import "AppDelegate.h"
#import "ViewController.h"
#import "DDLog.h"
#import "DDTTYLogger.h"
// Log levels: off, error, warn, info, verbose
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
@implementation AppDelegate
@synthesize window;
@synthesize viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Standard lumberjack initialization
[DDLog addLogger:[DDTTYLogger sharedInstance]];
// And we're going to enable colors
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];
// Check out default colors:
// Error : Red
// Warn : Orange
DDLogError(@"Paper jam");
DDLogWarn(@"Toner is low");
DDLogInfo(@"Warming up printer (pre-customization)");
DDLogVerbose(@"Intializing protcol x26");
// Now let's do some customization:
// Info : Pink
UIColor *pink = [UIColor colorWithRed:(255/255.0) green:(58/255.0) blue:(159/255.0) alpha:1.0];
[[DDTTYLogger sharedInstance] setForegroundColor:pink backgroundColor:nil forFlag:LOG_FLAG_INFO];
DDLogInfo(@"Warming up printer (post-customization)");
// Normal iOS UI stuff
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
// Update label for better understanding.
//
// Be sure to install XcodeColors (an Xcode plugin)
// https://github.com/robbiehanson/XcodeColors
char *xcode_colors = getenv("XcodeColors");
if (xcode_colors)
{
if (strcmp(xcode_colors, "YES") == 0)
viewController.label.text = @"XcodeColors enabled";
else
viewController.label.text = @"XcodeColors disabled";
}
else
{
viewController.label.text = @"XcodeColors not detected";
}
return YES;
}
@end
Jump to Line
Something went wrong with that request. Please try again.