android.util.Log when publishing - what can I do / not do

前端 未结 3 526
终归单人心
终归单人心 2020-12-15 12:15

I\'ve got a hell of a lot of Log.i Log.d Log.e in my code for a recent app I\'ve done. I\'m about to publish this app and I don\'t really want people seeing it when they plu

3条回答
  •  情话喂你
    2020-12-15 12:48

    It is generally a good practice to not include them in your distribution code in any way since they will need to be processed which just leads to unnecessary battery drain.

    You could set a boolean in your application somewhere to indicate development or release version of your code and have a lot of if blocks checking for the flag and executing your log code or not but this just leads to code bloat.

    You should get rid of them once you no longer need them.

提交回复
热议问题