NSLog
lastmod 2015-04-04created 2015-04-042 edits
A class that outputs log information. It can be used in Objective-C in XCode.
Example
Here is how to set up NSLog to work only in DEBUG mode.1(It also prints the file and position (line) that output the log)
#if defined( _DEBUG )
# define NSDLog( str, ... ) NSLog( @"<%@(%d)> %@", [[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat: (str), ##__VA_ARGS__] )
#else
# define NSDLog( str, ... )
#endif
References
-
Usually defined in a *.pch file. ↩