2010-10-02

DLOG macro for NSLog, __PRETTY_FUNCTION__, and ##_VA_ARGS__.

My DLOG macro, stolen from Mark Damon Hughes.

#ifdef DEBUG
    #define DLOG(fmt, ...) NSLog(@"%s: " fmt, __PRETTY_FUNCTION__, ##__VA_ARGS__)
#else
    #define DLOG(...)
#endif

Explanation of gcc's __PRETTY_FUNCTION__.

Explanation of __VA_ARGS__ especially the ## operator.

No comments:

Post a Comment