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:
@@ -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());
|
||||
|
Reference in New Issue
Block a user