mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 00:33:09 +02:00
Make it possible to see logs in release builds as well
by enabling the logs when debug mode is activated.
This commit is contained in:
@@ -22,13 +22,21 @@ import timber.log.Timber;
|
|||||||
|
|
||||||
public class Application extends android.app.Application {
|
public class Application extends android.app.Application {
|
||||||
|
|
||||||
|
private class TimberLogAdapter extends Timber.DebugTree {
|
||||||
|
@Override
|
||||||
|
protected boolean isLoggable(String tag, int priority) {
|
||||||
|
if (BuildConfig.DEBUG || OpenScale.DEBUG_MODE) {
|
||||||
|
return super.isLoggable(tag, priority);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
Timber.plant(new TimberLogAdapter());
|
||||||
Timber.plant(new Timber.DebugTree());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create OpenScale instance
|
// Create OpenScale instance
|
||||||
OpenScale.createInstance(getApplicationContext());
|
OpenScale.createInstance(getApplicationContext());
|
||||||
|
Reference in New Issue
Block a user