Fixed: remove library CocoaLumberjack in XcodeCapp. This lib added memory leaks when using it in an NSOperation. We now simply use NSLog

This commit is contained in:
Alexandre Wilhelm
2015-11-13 10:48:02 -08:00
parent bacb7018cb
commit f41504ca57
40 changed files with 4504 additions and 3618 deletions
+3 -25
View File
@@ -19,7 +19,6 @@
{
NSDictionary *appDefaults = @{
XCCUserDefaultsAutoOpenXcodeProject: @YES,
XCCUserDefaultsLogLevel: @LOG_LEVEL_WARN,
XCCUserDefaultsMaxNumberOfConcurrentOperations: @20
};
@@ -40,26 +39,6 @@
self->statusItem.length = self->imageStatusInactive.size.width + 12;
}
- (void)_initLogging
{
#if DEBUG
[DDLog addLogger:[DDTTYLogger sharedInstance]];
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];
[DDLogLevel setLogLevel:LOG_LEVEL_VERBOSE];
#else
[DDLog addLogger:[DDASLLogger sharedInstance]];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
int logLevel = (int)[defaults integerForKey:XCCUserDefaultsLogLevel];
NSUInteger modifiers = [NSEvent modifierFlags];
if (modifiers & NSAlternateKeyMask)
logLevel = LOG_LEVEL_VERBOSE;
[DDLogLevel setLogLevel:logLevel];
#endif
}
- (void)_initOperationQueue
{
self.mainOperationQueue = [NSOperationQueue new];
@@ -116,12 +95,11 @@
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
DDLogVerbose(@"\n******************************\n** XcodeCapp started **\n******************************\n");
NSLog(@"\n******************************\n** XcodeCapp started **\n******************************\n");
self.version = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
[self _initUserDefaults];
[self _initLogging];
[self _initOperationQueue];
[self _initStatusItem];
@@ -132,7 +110,7 @@
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
{
DDLogVerbose(@"Stop listening to all projects");
NSLog(@"Stop listening to all projects");
[self.mainWindowController notifyCappuccinoControllersApplicationIsClosing];
[[NSUserDefaults standardUserDefaults] synchronize];
@@ -141,7 +119,7 @@
- (void)applicationWillTerminate:(NSNotification *)aNotification
{
DDLogVerbose(@"\n******************************\n** XcodeCapp stopped **\n******************************\n");
NSLog(@"\n******************************\n** XcodeCapp stopped **\n******************************\n");
}
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag