1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-22 16:23: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:
Erik Johansson
2018-05-26 23:19:43 +02:00
parent ced597c07c
commit b52d927472

View File

@@ -22,13 +22,21 @@ import timber.log.Timber;
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
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
}
Timber.plant(new TimberLogAdapter());
// Create OpenScale instance
OpenScale.createInstance(getApplicationContext());