discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog options


From: Richard Frith-Macdonald
Subject: Re: NSLog options
Date: Mon, 6 Feb 2012 08:15:07 +0000

On 5 Feb 2012, at 21:12, Dick Seabrook wrote:

> I'm running GNUstep on Centos and Objective-C seems to work fine so far.
> One slight problem, NSLog output lines always start with the date, time,
> progname (in this case trngen) and byte count of the call, like this:

Minor correction ... that's the process ID, not a byte count.

>     2012-02-05 16:00:07.984 trngen[14042] <output shows up here>
> 
> Is there a compiler or NSLog option for shutting this off so I just get
> the output?

No ... the point about NSLog is to report a standard log format with 
information about the process logging etc, so the prefix is mandatory (though 
there *is* an option to get it to report thread ID as well as process ID).

That said, It's possible to set a default to have NSLog output go to syslog 
rather than stderr, and it's also possible to intercept the logging in your 
code (you should read the NSLog documentation for details) and do what you like 
with it.

But, if you really don't want the header produced by NSLog(), you can simply 
call fprintf(stderr,...) instead.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]