• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa and NSLog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Cocoa and NSLog
      • From: Tommy Nordgren <email@hidden>
References: 
 >Cocoa and NSLog (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: Help with this crashing method
  • Next by Date: Detect microphone
  • Previous by thread: Re: Cocoa and NSLog
  • Next by thread: Re: Cocoa and NSLog
  • Index(es):
    • Date
    • Thread