Quantcast
Channel: How to remove all debug logging calls before building the release version of an Android app? - Stack Overflow
Viewing all articles
Browse latest Browse all 32

Answer by Youngjae for How to remove all debug logging calls before building the release version of an Android app?

$
0
0

As zserge's comment suggested,

Timber is very nice, but if you already have an existing project - you may try github.com/zserge/log . It's a drop-in replacement for android.util.Log and has most of the the features that Timber has and even more.

his log library provides simple enable/disable log printing switch as below.

In addition, it only requires to change import lines, and nothing needs to change for Log.d(...); statement.

if (!BuildConfig.DEBUG)
    Log.usePrinter(Log.ANDROID, false); // from now on Log.d etc do nothing and is likely to be optimized with JIT

Viewing all articles
Browse latest Browse all 32

Trending Articles