I was reading the the Android Publishing docs and they said to remove all Log calls from my code. I have some calls to e.printStackTrace() in my code that can be printed as part of the normal running of my program (ie. if a file does not exist yet).
Should I also remove these calls?
You shouldn’t be using
e.printStackTrace()directly anyway — doing so will send the info to the Android log without displaying which application (log tag) it came from.As others have mentioned, continue to catch the
Exceptionin question, but use one of theandroid.util.Logmethods to do the logging. You could log only the message, but not the stack trace, or use verbose logging for the stack trace:You should strip
DEBUGorVERBOSElog messages from your production builds. The easiest way is to use ProGuard to removeLog.[dv]calls from your code.