Skip to content

Commit

Permalink
More debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
griff committed Mar 29, 2018
1 parent 5908927 commit dcb8ef6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Framework/src/MZDataProviderPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

@implementation MZDataProviderPlugin

- (BOOL)isEnabled
{
return YES;
}


- (NSArray *)types
{
NSArray* types = [self.bundle objectForInfoDictionaryKey:@"CFBundleDocumentTypes"];
Expand Down
14 changes: 11 additions & 3 deletions Framework/src/MZOperationsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,30 @@ - (void)addOperationsToQueue:(NSOperationQueue*)queue

- (void)operationFinished:(GTMKeyValueChangeNotification *)notification
{
MZLoggerDebug("Finished operation");
@synchronized(self)
{
if(self.finished)
if(self.finished) {
MZLoggerDebug("Everything already finished");
return;
for(NSOperation* op in self.operations)
if(![op isFinished])
}
for(NSOperation* op in self.operations) {
if(![op isFinished]) {
MZLoggerDebug("Not all finished");
return;
}
}
self.finished = YES;
}
MZLoggerDebug("Sending operationsFinished");
[self retain];
[self performSelectorOnMainThread:@selector(operationsFinished) withObject:nil waitUntilDone:YES];
[self release];
}

- (void)errorChanged:(GTMKeyValueChangeNotification *)notification
{
MZLoggerDebug("Error changed");
MZErrorOperation* op = [notification object];
self.error = op.error;
}
Expand Down
7 changes: 6 additions & 1 deletion Framework/src/MZPluginController.m
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ - (BOOL)loadPluginFromSource:(id)source error:(NSError **)error;
[plugin didLoad];
if([[self delegate] respondsToSelector:@selector(pluginController:loadedPlugin:)])
[[self delegate] pluginController:self loadedPlugin:plugin];
if (![plugin isEnabled]) {
MZLoggerInfo(@"Disabled plugin '%@'", identifier);
}
return YES;
}

Expand Down Expand Up @@ -705,8 +708,10 @@ - (MZSearchProviderPlugin *)searchProviderWithIdentifier:(NSString *)identifier
extra:(NSDictionary *)extra
{
MZDataProviderPlugin* provider = [self dataProviderForPath:fileName];
if(!provider)
if(!provider) {
MZLoggerInfo(@"No plugin for file '%@'", fileName);
return nil;
}

id<MZDataReadDelegate> otherDelegate = [MZReadNotification notifierWithController:self delegate:theDelegate];
return [provider loadFromFile:fileName delegate:otherDelegate queue:loadQueue extra:extra];
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/MZTaskOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ - (void)setErrorString:(NSString *)err code:(int)status
}

NSString* program = [[task launchPath] lastPathComponent];
MZLoggerError(@"%@", err);
MZLoggerError(@"Task error %@", err);
NSDictionary* dict = [NSDictionary dictionaryWithObject:err
forKey:NSLocalizedDescriptionKey];
self.error = [NSError errorWithDomain:program code:status userInfo:dict];
Expand Down

0 comments on commit dcb8ef6

Please sign in to comment.