Re: Cocoa and NSLog
Re: Cocoa and NSLog
- Subject: Re: Cocoa and NSLog
- From: Marcus <email@hidden>
- Date: Mon, 10 Nov 2008 07:16:24 +0100
9 nov 2008 kl. 23.03 skrev Tommy Nordgren:
Is it possible to open an Additional file for use by logging in Cocoa
(I want it to contain ONLY the info logged from my App)
You can do that by just redirect standard error to a file. Since each
process has their own set of file descriptors it will only affect your
application.
int fd = creat ("/Users/marcus/my_log", S_IRUSR | S_IWUSR | S_IRGRP |
S_IROTH);
close (STDERR_FILENO);
dup (fd);
close (fd);
NSLog(@"this will be written to my_log");
Marcus
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden