logs only when in DEBUG

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@8493 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Robert Slover 2001-01-07 14:10:59 +00:00
parent 04d292688f
commit d59201b358

View file

@ -199,7 +199,9 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
id<ProjectType> concretBuilder; id<ProjectType> concretBuilder;
PCProject *project; PCProject *project;
#ifdef DEBUG
NSLog([NSString stringWithFormat:@"Builders %@ for key %@",[builders description],builderKey]); NSLog([NSString stringWithFormat:@"Builders %@ for key %@",[builders description],builderKey]);
#endif DEBUG
concretBuilder = [NSClassFromString([builders objectForKey:builderKey]) sharedCreator]; concretBuilder = [NSClassFromString([builders objectForKey:builderKey]) sharedCreator];
@ -210,9 +212,11 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
} }
} }
} }
#ifdef DEBUG
else { else {
NSLog(@"No project manager delegate available!"); NSLog(@"No project manager delegate available!");
} }
#endif DEBUG
return nil; return nil;
} }
@ -222,24 +226,28 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
BOOL isDir = NO; BOOL isDir = NO;
if ([loadedProjects objectForKey:aPath]) { if ([loadedProjects objectForKey:aPath]) {
NSLog([NSString stringWithFormat:@"Project %@ is already loaded!",aPath]); #ifdef DEBUG
return NO; NSLog([NSString stringWithFormat:@"Project %@ is already loaded!",aPath]);
#endif DEBUG
return NO;
} }
if ([[NSFileManager defaultManager] fileExistsAtPath:aPath isDirectory:&isDir] && !isDir) { if ([[NSFileManager defaultManager] fileExistsAtPath:aPath isDirectory:&isDir] && !isDir) {
PCProject *project = [self loadProjectAt:aPath]; PCProject *project = [self loadProjectAt:aPath];
if (!project) { if (!project) {
NSLog(@"Couldn't instantiate the project..."); #ifdef DEBUG
return NO; NSLog(@"Couldn't instantiate the project...");
} #endif DEBUG
return NO;
[project setProjectBuilder:self]; }
[loadedProjects setObject:project forKey:aPath];
[self setActiveProject:project]; [project setProjectBuilder:self];
[project setDelegate:self]; [loadedProjects setObject:project forKey:aPath];
[self setActiveProject:project];
return YES; [project setDelegate:self];
return YES;
} }
return NO; return NO;
} }
@ -419,15 +427,17 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
- (NSString *)fileManager:(id)sender willCreateFile:(NSString *)aFile withKey:(NSString *)key - (NSString *)fileManager:(id)sender willCreateFile:(NSString *)aFile withKey:(NSString *)key
{ {
NSString *path = nil; NSString *path = nil;
#ifdef DEBUG
NSLog(@"%@ %x: will create file %@ for key %@.",[self class],self,aFile,key);
#endif DEBUG
NSLog(@"<%@ %x>: will create file %@ for key %@",[self class],self,aFile,key); if ([activeProject doesAcceptFile:aFile forKey:key] ) {
path = [[activeProject projectPath] stringByAppendingPathComponent:aFile];
if ([activeProject doesAcceptFile:aFile forKey:key] ) { }
path = [[activeProject projectPath] stringByAppendingPathComponent:aFile];
} return path;
return path;
} }
- (void)fileManager:(id)sender didCreateFile:(NSString *)aFile withKey:(NSString *)key - (void)fileManager:(id)sender didCreateFile:(NSString *)aFile withKey:(NSString *)key