Re: Removing NSLog & NSAssert for deployment
Re: Removing NSLog & NSAssert for deployment
- Subject: Re: Removing NSLog & NSAssert for deployment
- From: Andreas Monitzer <email@hidden>
- Date: Thu, 7 Feb 2002 23:12:59 +0100
On Thursday, February 7, 2002, at 10:39 , Finlay Dobbie wrote:
You'll have to make a macro function, something along the lines of:
#define SHOW_DEBUG_STRINGS
#ifdef SHOW_DEBUG_STRINGS
#define DLOG(fmt, args...) NSLog(fmt, ## args)
#else
#define DLOG(fmt, args...)
#endif
Then you can use DLOG(@"foo"). Not sure if that exact code will work,
just typed it looking at how AppleSCCSerial implements it (since I'm
currently looking at the code, and of course it uses IOLog instead of
NSLog ;-)).
You'd have to disable the cpp-precomp, because it doesn't support
vararg-#defines (because it's not important according to some apple
engineer). That means no precompiled headers, so your build will take a
looong time.
Workaround:
#ifdef SHOW_DEBUG_STRINGS
#define DLOG(x) NSLog(x)
#else
#define DLOG(x)
#endif
Then use DLOG((@"foo: %s","bar")); (two parentheses). You might get a
warning though.
andy
_______________________________________________
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.