Corona tip: Turning off debug print statements

January 22, 2013 at 3:44pm

Want to turn off your debug print statements for your production build?

 

Add this little block of code to your main.lua:

 

debugMode = true

cachePrint = print

function print(...)   

if debugMode then       

cachePrint(unpack(arg))   

end

end

 

Then to turn it off, change "debugMode" to false.