• 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: NSLog() replacement for debugger output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog() replacement for debugger output


  • Subject: Re: NSLog() replacement for debugger output
  • From: "Herb Petschauer" <email@hidden>
  • Date: Thu, 24 Apr 2008 15:43:12 -0700

What happens in a release build in this situation?

if ( TRUE == someCondition )
    DBOut( @"someCondition happened" );

[foo someMethod];


I'd recommend the

#define DBOut(fmt, ...)\
do\
{\
    fprintf(etc);\
}\
while ( false )

pattern lest you get different results in DEBUG vs non DEBUG code (no
reason to space the #define out like I've done if you don't want to).

Cheers,
-H.

On 24/04/2008, Don Arnel <email@hidden> wrote:
> If you cut and pasted the code make sure each line begins with the #
> character. If not then your mail reader wrapped a long line onto the next
> line.
>
>
>  On Apr 24, 2008, at 6:20 PM, Mohsan Khan wrote:
>
>
> > Sorry, I was a little bit to quick there...
> >
> > I get an error
> >
> > 169: DBOut( @"Hello World!" );
> > /AppController.m:169: error: syntax error before ']' token
> >
> > Did I miss something?
> >
>
>  _______________________________________________
>
>  Cocoa-dev mailing list (email@hidden)
>
>  Please do not post admin requests or moderator comments to the list.
>  Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>  Help/Unsubscribe/Update your Subscription:
>
>  This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSLog() replacement for debugger output
      • From: Ken Thomases <email@hidden>
References: 
 >NSLog() replacement for debugger output (From: Don Arnel <email@hidden>)
 >Re: NSLog() replacement for debugger output (From: Mohsan Khan <email@hidden>)
 >Re: NSLog() replacement for debugger output (From: Mohsan Khan <email@hidden>)
 >Re: NSLog() replacement for debugger output (From: Don Arnel <email@hidden>)

  • Prev by Date: Re: NSLog() replacement for debugger output
  • Next by Date: Re: QTMovie grabing while playback
  • Previous by thread: Re: NSLog() replacement for debugger output
  • Next by thread: Re: NSLog() replacement for debugger output
  • Index(es):
    • Date
    • Thread