Re: Is there a way to route NSLog to standard out?
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.