mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-20 07:21:40 +02:00
Add Timber library for logging
The idea is to add a Tree that can save the log to a file which can be enabled from the settings.
This commit is contained in:
@@ -57,6 +57,9 @@ dependencies {
|
||||
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0'
|
||||
androidTestImplementation 'android.arch.persistence.room:testing:1.0.0'
|
||||
|
||||
// Timber
|
||||
implementation 'com.jakewharton.timber:timber:4.7.0'
|
||||
|
||||
// Local unit tests
|
||||
testImplementation 'junit:junit:4.12'
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher_openscale"
|
||||
android:label="@string/app_name"
|
||||
android:name=".core.Application"
|
||||
android:theme="@style/AppTheme_Light" >
|
||||
<activity
|
||||
android:name=".gui.MainActivity"
|
||||
|
@@ -0,0 +1,33 @@
|
||||
/* Copyright (C) 2018 Erik Johansson <erik@ejohansson.se>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.health.openscale.core;
|
||||
|
||||
import com.health.openscale.BuildConfig;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
public class Application extends android.app.Application {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Timber.plant(new Timber.DebugTree());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user