This shows you the differences between two versions of the page.
— |
objective-c:examples:xlog [2024/02/16 01:06] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== XLog for Objective-C ====== | ||
+ | add this code to your **//App//-Prefix.pch** | ||
+ | |||
+ | <code objc> | ||
+ | /** | ||
+ | XLog a working version | ||
+ | source: http://code-reference.com | ||
+ | */ | ||
+ | |||
+ | /* remove the // to turn off Logs */ | ||
+ | //#define RELEASE_MODE 1 | ||
+ | |||
+ | #ifdef RELEASE_MODE | ||
+ | #define XLog(...) | ||
+ | #else | ||
+ | |||
+ | #define XLog(fmt, ...) NSLog(@"%s line:%d " fmt, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) | ||
+ | #endif | ||
+ | </code> | ||
+ | |||
+ | ==== output of XLog ==== | ||
+ | 2013-03-23 19:45:59.098 cppApp[28436:c07] -[ViewController tableView:cellForRowAtIndexPath:] line:101 indexpath 0 | ||