Re: NSLog() replacement for debugger output
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