Various minor improvements.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13722 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-05-27 14:03:10 +00:00
parent 97d4a3e0d0
commit 41d0a79f08
6 changed files with 155 additions and 62 deletions

View file

@ -67,6 +67,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <GSConfig.h>
#include <Foundation/NSString.h>
#include <Foundation/NSArray.h>
@ -760,6 +762,28 @@ int main(int argc, char *argv[], char *env[])
return _debug_set;
}
/**
* Set the file to which NSLog output should be directed.<br />
* Returns YES on success, NO on failure.<br />
* By default logging goes to standard error.
*/
- (BOOL) setLogFile: (NSString*)path
{
extern int _NSLogDescriptor;
int desc;
desc = open([path fileSystemRepresentation], O_RDWR|O_CREAT|O_APPEND, 0644);
if (desc >= 0)
{
if (_NSLogDescriptor >= 0 && _NSLogDescriptor != 2)
{
close(_NSLogDescriptor);
}
_NSLogDescriptor = desc;
return YES;
}
return NO;
}
@end
/**