• 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: Is there a way to route NSLog to standard out?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to route NSLog to standard out?


  • Subject: Re: Is there a way to route NSLog to standard out?
  • From: Marcel Weiher <email@hidden>
  • Date: Sat, 13 Jul 2002 11:55:10 +0200

You could redirect stderr to stdout either on invocation using the shell, or internally using freopen().

However...

...the question suggests that you're misusing NSLog(), because NSLog() is only intended for informational/debugging diagnostics that go to stderr, not for data output or the type of logging that goes to stdout.

For that sort of thing, my personal and somewhat biased favorite is the MPWByteStream ( part of MPWFoundation ). One of the many neat things about a MPWByteStream is that you can subclass it to get precisely the type of object format you want. You can also easily redirect it to a NSData, NSString, files, or your own custom objects.

Marcel

On Thursday, July 11, 2002, at 02:53 Uhr, Gjermund Gusland Thorsen wrote:

It's quiet annoying to compile a Foundation tool where the output cannot be piped :-(

Or did NeXT invent any funky pipes for standard NS?

my.app NS> ./my_output_test.txt

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Is there a way to route NSLog to standard out?
      • From: petite_abeille <email@hidden>
  • Prev by Date: Re: Getting the contenst of a mount point with a NSFileWrapper
  • Next by Date: Re: Is there a way to route NSLog to standard out?
  • Previous by thread: Re: Is there a way to route NSLog to standard out?
  • Next by thread: Re: Is there a way to route NSLog to standard out?
  • Index(es):
    • Date
    • Thread