Is there a way to have the app crash and burn at runtime on print()
?
Override print()
in Swift runtime with an implementation that'd preconditionFailure("STOP using print()")
.
Basically it's a part of the team Pavlov's dog training in progress: I want people to use debugPrint rather than print to pollute console in debug builds only.
UPD20180525: matt is right: print output does not go to a live console of a real device, it somehow only ends up on lldb console.
NSLog output thought DOES go to the device's console so what needs to be killed at runtime or compile time for non debug builds is NSLog
This is what was actually needed:
#if DEBUG
#else
public func NSLog(_ format: String, _ args: CVarArg...)
{
}
#endif
(cause there is no real need to get rid of print which is harmless in release builds)