When we submit the application with NSLog
statements,
What will be the effect of the statements? Will those still executes? If it executes will these logs stored somewhere as application logs / system logs? Can we see those? Is it connected to Apple crash reporting in iTunesConnect?
Please clarify my doubts.
As such, you can rely on it being available for your debugging purposes on any Apple platform where your app will run. NSLog outputs messages to the Apple System Log facility or to the Console app (usually prefixed with the time and the process id).
In the Thread Programming Guide, NSLog() is listed as being 'generally considered to be thread-safe'.
Short answer :-
NSLog
calls can be left in production code. It will be logged in the system log.
Applications which litter the system log are annoying, and is an unprofessional way. So try to use Macros in Logging such that you can remove log code execution in production
#define DEBUG_MODE
#ifdef DEBUG_MODE
#define DebugLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DebugLog( s, ... )
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With