During development I’ve been logging errors and info messages (Console.log, Console.info, Console.error), without printing passwords or any other sensitive data.
I would to know if it’s ok to let those logs in my released app (Production) or if it’s a better practice to remove them and in that case if there is a way to keep the Console calls in the code without breaking the app.
Remove console.logs because you do not need them in production. You can not debug production apps, yet. If you build apk or ipa with the keystores/certificates you are not allowed to debug.
In reality you would connect your app a error-tracking API --> sending an error report if a hard error occurs.
Thanks for your answer
I checked some documentation and found that UglifyJS2 has an option “drop_console” that would help me to remove the “console.x” calls automatically.
We have been using $log for debugging. Am I right in assuming that code gets “switched off” in release builds? Or is there some other to switch/configure that?