• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Removing NSLog & NSAssert for deployment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Removing NSLog & NSAssert for deployment (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: Removing NSLog & NSAssert for deployment
  • Next by Date: URL types example
  • Previous by thread: Re: Removing NSLog & NSAssert for deployment
  • Next by thread: Re: Removing NSLog & NSAssert for deployment
  • Index(es):
    • Date
    • Thread