0

At one point, I ran across some Android documentation that recommended writing debug code like this:

if (someSymbol) then { .. debug code like log }

where someSymbol was automatically set by the compiler to either true (for debug) or false (for release). Then the debug code is optimized out in the release version.

But I didn't write it down, and now I can't find it.

What is that symbol?

Stephen Leake
  • 164
  • 1
  • 8
  • Try "if (BuildConfig.DEBUG) {...}" according to http://stackoverflow.com/questions/23844667/android-detect-if-i-am-in-release-or-debug-mode. –  Jul 11 '15 at 14:09

1 Answers1

0

(Just so this shows up as answered)

The symbol is BuildConfig.DEBUG

Stephen Leake
  • 164
  • 1
  • 8