What I do is add a macro that does the logging only when I am in Debug mode. Put this in your <APP_NAME>_Prefix.pch
file
#ifdef DEBUG
#define DebugLog( s, ... ) NSLog( @"<%p %@:%d (%@)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, NSStringFromSelector(_cmd), [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DebugLog( s, ... )
#endif
As a bonus to the regular log, you get filename, method name, and line number.
Then in the project info, add this under the debug build only. It goes in the User-defined
sections under GCC_PREPROCESSOR_DEFINITIONS:
DEBUG
Then replace any of the NSLog's you have in your project with DebugLog (it takes the same args as NSLog) and you won't have to worry about releasing debug statements live.
In answer to your question, logging can slow down the performance of an app and unless you require them for help debugging in the wild, I would leave them out.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…