discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSLog options


From: Dick Seabrook
Subject: Re: NSLog options
Date: Mon, 6 Feb 2012 09:32:56 -0500

On Mon, Feb 6, 2012 at 9:11 AM, Matt Rice <ratmice@gmail.com> wrote:
> On Mon, Feb 6, 2012 at 12:15 AM, Richard Frith-Macdonald
> <richard@tiptree.demon.co.uk> wrote:
>>
>> 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).
>
> FWIW, I have on occasion found the header to be annoying as well,
> (though I am well aware of fprintf/and GSPrintf if it still exists)
> note that use of %@ in fprintf isn't terribly portable, the reason why
> is the NSLogs already existed and I wanted to run diff on them (which
> the header screws up).

Thanks.  Based on advice from Mr Frith-Macdonald I solved the problem
by switching to fprintf(sysout,"...").  NSIntegers seem to work fine with
fprintf's %i format but for %s I had to unpack the string objects with
[<NSString variable> UTF8String ].  Output came out just fine.
Dick S.


-- 
Dick Seabrook
Anne Arundel Community College
http://vader.aacc.edu/~rhs
Speed the Net!



reply via email to

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