Skip navigation.
 
mlRe: NSLog() replacement for debugger output
FROM : Mohsan Khan
DATE : Thu Apr 24 23:24:54 2008

Ohh this is so good, I'm happy!!!

Thanks!



On to 24 apr 2008, at 21.53, Don Arnel wrote:

> I thought I'd share this with those of you who want an alternative 
> to NSLog(). If you want your debugging output to always go to the 
> debugger console without all the date and time stamping info, just 
> place this bit of code in your <AppName>_Prefix.pch file. Then 
> define the __DEBUG_OUT__ preprocessor macro in your Project Settings 
> for Debug builds.
>
> Once you have done this, debug output only occurs for debug builds. 
> For release builds, it's as if the  debug output code never existed.
>
> Usage:
>
> For NSString-style output use DBOut() the same way you would use 
> NSLog().
> For char *string output use DBCOut()
>
> Enjoy!
> - Don
>
> #ifdef __DEBUG_OUT__
> #define DBOut(fmt, ...)  fprintf(stderr, "%s\n", [[NSString 
> stringWithFormat:(fmt), __VA_ARGS__] 
> cStringUsingEncoding:NSUTF8StringEncoding])
> #define DBCOut(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
> #else
> #define DBOut(fmt, ...)    
> #define DBCOut(fmt, ...)    
> #endif
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlNSLog() replacement for debugger output Don Arnel Apr 24, 21:53
mlRe: NSLog() replacement for debugger output Mohsan Khan Apr 24, 23:24
mlRe: NSLog() replacement for debugger output Mohsan Khan Apr 25, 00:20
mlRe: NSLog() replacement for debugger output Ken Thomases Apr 25, 00:29
mlRe: NSLog() replacement for debugger output Don Arnel Apr 25, 00:33
mlRe: NSLog() replacement for debugger output Don Arnel Apr 25, 00:42
mlRe: NSLog() replacement for debugger output Herb Petschauer Apr 25, 00:43
mlRe: NSLog() replacement for debugger output Ken Thomases Apr 25, 01:54
mlRe: NSLog() replacement for debugger output Herb Petschauer Apr 25, 03:26
mlRe: NSLog() replacement for debugger output Michael Ash Apr 25, 05:09
mlRe: NSLog() replacement for debugger output Jens Alfke Apr 25, 05:57
mlRe: NSLog() replacement for debugger output Michael Ash Apr 25, 06:31
mlRe: NSLog() replacement for debugger output Herb Petschauer Apr 25, 06:36
mlRe: NSLog() replacement for debugger output Rob Petrovec Apr 27, 05:08