On Tuesday, October 8, 2002, at 06:37  pm, Jeff Teunissen wrote:

> Adam Fedor wrote:
>
>> Pascal Bourguignon wrote:
>>
>>> It should be  quite easy to add a function to  set the file 
>>> descriptor
>>> (or a  stream, which could be  a memory stream) to  which NSLog 
>>> output
>>> should be sent.
>>
>> You can already create your own NSLog_print_handler to take over the 
>> job
>> of dealing with NSLog output. There's even a user preference to 
>> redirect
>> the output to syslog.
>
> Yes, there is...unfortunately, it's not as useful as it could be -- 
> tools
> often use NSLog() to output information that should always be printed 
> to
> stdout. I was trying to figure out what was wrong with a plist, and
> getting confused because plparse was producing no output. :)
>
> So, consider this a bug report. :)

Yep ... I admit to laziness ... in the tools I've written I have often 
used
NSLog() to write strings out, because I can just do

   NSLog("%@",foo);

rather than having to write the much longer

   {
     NSString   *s = [foo description];
     NSData     *d = [s dataUsingEncoding: [NSString 
defaultCStringEncoding]];

     if (d == nil)
       {
         d = [s dataUsingEncoding: NSUTF8StringEncoding];
       }
      fprintf(stderr, "%*.*s\n", [d length], [d length], [d bytes]);
   }

Perhaps having a GSPrintf() function to write formatted data to a FILE 
would be
a worthwhile addition to GNUstep?



_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to