• 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
Redirect NSLog to stdout?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Redirect NSLog to stdout?


  • Subject: Redirect NSLog to stdout?
  • From: Tito Ciuro <email@hidden>
  • Date: Tue, 29 Jun 2010 16:09:17 +0200

Hello,

I have written a small app which gets launched when SuperDuper has finished backing up my data. The problem is that since NSLog() writes to stderr, SuperDuper treats this as an error. The advice I've been given is to redirect NSLog() to stdout. One possible solution I can think of is the following:

void NSLogOut (NSString *someString)
{
     [someString writeToFile: @"/dev/stdout" atomically: NO];
}

Then I can call it everywhere like so:

NSLogOut(@"blah");

I don't really like it, since this forces me to use NSLogOut() everywhere... which kinda sucks. Instead, is there a way to configure NSLog() so that it redirects to stdout instead of stderr?

Thanks,

-- Tito
_______________________________________________

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: Redirect NSLog to stdout?
      • From: Butch Anton <email@hidden>
    • Re: Redirect NSLog to stdout?
      • From: Bill Garrison <email@hidden>
    • Re: Redirect NSLog to stdout?
      • From: Kyle Sluder <email@hidden>
    • Re: Redirect NSLog to stdout?
      • From: Graham Cox <email@hidden>
  • Prev by Date: How to revert to an unedited document & window?
  • Next by Date: Re: Redirect NSLog to stdout?
  • Previous by thread: Re: How to revert to an unedited document & window?
  • Next by thread: Re: Redirect NSLog to stdout?
  • Index(es):
    • Date
    • Thread