0

I want to make calls to Log in debug but not make these Logs in release build, how should this be handled? checking for BuildConfig.DEBUG flag every time seems awkward.

Even making a util method to call and checking there will result in multiple useless method calls in release builds.

ir2pid
  • 5,604
  • 12
  • 63
  • 107

1 Answers1

1

I think this is a duplicate of Remove all debug logging calls before publishing: are there tools to do this??

TL;DR You can use a program like progaurd to strip out the logs
You can use a different logging system
You can use a wrapper function or if statements as you have suggested.

Community
  • 1
  • 1
user3362964
  • 33
  • 1
  • 4
  • I'm asking for the most preferred way from the above options, but I'll go through http://stackoverflow.com/questions/2446248/remove-all-debug-logging-calls-before-publishing-are-there-tools-to-do-this – ir2pid Apr 13 '17 at 15:02