Revised NSDebugLog() stuff

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2899 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1998-08-04 10:45:43 +00:00
parent 7fad1ff16e
commit 7e5d16ae78
7 changed files with 60 additions and 18 deletions

View file

@ -29,6 +29,7 @@
#include <Foundation/NSException.h>
#include <Foundation/NSString.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSDebug.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSProcessInfo.h>
#include <Foundation/NSObjCRuntime.h>
@ -255,7 +256,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
if ([s isEqual: gnustep_target_cpu])
path = [path stringByDeletingLastPathComponent];
NSDebugLog(@"(NSBundle): Found main in %@\n", path);
NSDebugLog(@"NSBundle", @"(NSBundle): Found main in %@\n", path);
/* We do alloc and init separately so initWithPath: knows
we are the _mainBundle */
_mainBundle = [NSBundle alloc];
@ -338,7 +339,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
if (stat([path cString], &statbuf) != 0)
{
NSDebugLog(@"Could not access path %s for bundle", [path cString]);
NSDebugLog(@"NSBundle", @"Could not access path %s for bundle", [path cString]);
//[self dealloc];
//return nil;
}

View file

@ -128,6 +128,9 @@ static NSArray* _gnu_arguments = nil;
// Dictionary of environment vars and their values
static NSMutableDictionary* _gnu_environment = nil;
// Array of debug levels set.
static NSMutableArray* _debug_array = nil;
/*************************************************************************
*** Implementing the Libobjects main function
*************************************************************************/
@ -143,9 +146,18 @@ _gnu_process_args(int argc, char *argv[], char *env[])
/* Copy the argument list */
{
id obj_argv[argc];
int added = 0;
_debug_array = [[NSMutableArray alloc] init];
for (i = 1; i < argc; i++)
obj_argv[i-1] = [NSString stringWithCString:argv[i]];
_gnu_arguments = [[NSArray alloc] initWithObjects:obj_argv count:argc-1];
{
NSString *str = [NSString stringWithCString:argv[i]];
if ([str hasPrefix: @"--GNU-Debug="])
[_debug_array addObject: [str substringFromIndex: 12]];
else
obj_argv[added++] = str;
}
_gnu_arguments = [[NSArray alloc] initWithObjects:obj_argv count:added];
}
/* Copy the evironment list */
@ -347,6 +359,11 @@ int main(int argc, char *argv[], char *env[])
return _gnu_arguments;
}
- (NSMutableArray*) debugArray
{
return _debug_array;
}
- (NSDictionary *)environment
{
return _gnu_environment;

View file

@ -22,6 +22,7 @@
*/
#include <config.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSString.h>
#include <Foundation/NSException.h>
#include <Foundation/NSMapTable.h>
@ -34,9 +35,6 @@
creating the potential for deadlock. */
NSRecursiveLock *gnustep_global_lock = nil;
/* Set this variable to print NSDebugLog messages */
int NSDebugLogging = NO;
/* Connection Notification Strings. */
NSString *ConnectionBecameInvalidNotification =