Turning on NSLogs

Kelly O'Hair kelly.ohair at oracle.com
Thu Dec 1 08:02:44 PST 2011


On Dec 1, 2011, at 2:40 AM, Artem Ananiev wrote:

> 
> On 12/1/2011 2:05 AM, Pete Brunet wrote:
>> On 11/30/11 2:10 PM, Mike Swingler wrote:
>>> On Nov 30, 2011, at 10:01 AM, Pete Brunet wrote:
>>> 
>>>> I'm seeing code like this
>>>> 
>>>> #ifdef JAVA_AX_DEBUG
>>>>    NSLog(@"%s: %@", __FUNCTION__, value);
>>>> #endif
>>>> 
>>>> What is the correct way to turn on a definition?
>>> #define JAVA_AX_DEBUG 1
>> Thanks Mike, What I meant was, can I do something like -DJAVA_AX_DEBUG
>> when invoking make?
> 
> I'm not a make expert, but I doubt it would work that way. Instead, you should add an explicit rule, e.g.
> 
> ifeq ($(VARIANT), DBG)
>  OTHER_CFLAGS += -DJAVA_AX_DEBUG
>  OTHER_CPPFLAGS += -DJAVA_AX_DEBUG
> endif
> 
> to the corresponding Makefile and build in the debug or fastdebug mode.

I think that is correct.  Nothing will magically add a -D option to the compile lines from a make variable,
you need to be explicit.

-kto

> 
> Thanks,
> 
> Artem
> 
>>>> I'm also seeing NSLogs which are not bracketed with a define.  Does
>>>> NSLog always output to stdout or does it need a switch of some sort?
>>> NSLog goes to both stderr and the ASL database (which Console.app shows and lets you query).
>> I see lots of logs in /Library/Logs.  Is one of these the "Java" log?
>>> 
>>> Regards,
>>> Mike Swingler
>>> Apple Inc.
>>> 



More information about the macosx-port-dev mailing list