Skip to content

Commit 0b06dfd

Browse files
chirag-jncpg
authored andcommitted
Remove timber (#603)
Remove Timber
1 parent 074f0da commit 0b06dfd

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ android {
8484
buildTypes {
8585
betaRelease {
8686
signingConfig signingConfigs.debug
87+
debuggable false
8788
}
8889

8990
release {
9091
signingConfig signingConfigs.release
92+
debuggable false
9193
}
9294
}
9395

@@ -142,7 +144,6 @@ dependencies {
142144
implementation 'com.google.android.gms:play-services-cast-framework:11.6.0'
143145
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
144146
implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
145-
implementation 'com.jakewharton.timber:timber:4.7.1'
146147

147148
// Otto and Retrofit
148149
implementation 'com.squareup:otto:1.3.8'

src/main/java/org/amahi/anywhere/AmahiApplication.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.amahi.anywhere.server.Api;
4343

4444
import dagger.ObjectGraph;
45-
import timber.log.Timber;
4645

4746
/**
4847
* Application declaration. Basically sets things up at the startup time,
@@ -72,7 +71,7 @@ public void onCreate() {
7271
super.onCreate();
7372

7473
instance = this;
75-
setUpLogging();
74+
7675
setUpDetecting();
7776

7877
setUpInjections();
@@ -86,12 +85,6 @@ public void onCreate() {
8685
}
8786
}
8887

89-
private void setUpLogging() {
90-
if (isDebugging()) {
91-
Timber.plant(new Timber.DebugTree());
92-
}
93-
}
94-
9588
private void setUpTheme() {
9689
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
9790
this.isLightThemeEnabled = preferences.getBoolean(getString(R.string.pref_key_light_theme), false);

src/main/java/org/amahi/anywhere/activity/ServerFilesActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import android.os.IBinder;
3434
import android.preference.PreferenceManager;
3535
import android.provider.MediaStore;
36+
import android.util.Log;
3637
import android.view.MenuItem;
3738
import android.view.View;
3839
import android.widget.FrameLayout;
@@ -100,7 +101,6 @@
100101

101102
import pub.devrel.easypermissions.AppSettingsDialog;
102103
import pub.devrel.easypermissions.EasyPermissions;
103-
import timber.log.Timber;
104104

105105
/**
106106
* Files activity. Shows files navigation and operates basic file actions,
@@ -113,6 +113,8 @@ public class ServerFilesActivity extends AppCompatActivity implements
113113
CastStateListener,
114114
AlertDialogFragment.DuplicateFileDialogCallback {
115115

116+
public static final String TAG = ServerFilesActivity.class.getSimpleName();
117+
116118
private static final int FILE_UPLOAD_PERMISSION = 102;
117119
private static final int CAMERA_PERMISSION = 103;
118120
private static final int REQUEST_UPLOAD_IMAGE = 201;
@@ -438,7 +440,7 @@ private void openCamera() {
438440
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
439441
startActivityForResult(cameraIntent, REQUEST_CAMERA_IMAGE);
440442
} catch (IOException ex) {
441-
Timber.d(ex);
443+
Log.d(TAG, ex.getMessage());
442444
}
443445
}
444446
}

src/main/java/org/amahi/anywhere/fragment/ServerAppsFragment.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.amahi.anywhere.server.client.ServerClient;
4848
import org.amahi.anywhere.server.model.ServerApp;
4949
import org.amahi.anywhere.util.ViewDirector;
50-
import org.jetbrains.annotations.NotNull;
5150

5251
import java.util.ArrayList;
5352
import java.util.List;
@@ -234,7 +233,7 @@ public void onPause() {
234233
}
235234

236235
@Override
237-
public void onSaveInstanceState(@NotNull Bundle outState) {
236+
public void onSaveInstanceState(Bundle outState) {
238237
super.onSaveInstanceState(outState);
239238

240239
tearDownAppsState(outState);

src/main/java/org/amahi/anywhere/server/ApiConnectionDetector.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919

2020
package org.amahi.anywhere.server;
2121

22-
import android.content.res.Resources;
2322
import android.net.Uri;
23+
import android.util.Log;
2424

25-
import org.amahi.anywhere.R;
2625
import org.amahi.anywhere.server.model.ServerRoute;
2726
import org.amahi.anywhere.util.Constants;
2827

@@ -33,13 +32,15 @@
3332
import okhttp3.OkHttpClient;
3433
import okhttp3.Request;
3534
import okhttp3.Response;
36-
import timber.log.Timber;
3735

3836
/**
3937
* API connection guesser. Tries to connect to the server address to determine if it is available
4038
* and returns it if succeed or another one otherwise.
4139
*/
4240
public class ApiConnectionDetector {
41+
42+
public static final String TAG = ApiConnectionDetector.class.getSimpleName();
43+
4344
private OkHttpClient httpClient;
4445

4546
public ApiConnectionDetector() {
@@ -54,7 +55,7 @@ private OkHttpClient buildHttpClient() {
5455
}
5556

5657
public String detect(ServerRoute serverRoute) {
57-
Timber.tag(Constants.connection);
58+
Log.d(TAG, Constants.connection);
5859

5960
try {
6061
Request httpRequest = new Request.Builder()
@@ -67,11 +68,11 @@ public String detect(ServerRoute serverRoute) {
6768

6869
httpResponse.body().close();
6970

70-
Timber.d("Using local address.");
71+
Log.d(TAG, "Using local address.");
7172

7273
return serverRoute.getLocalAddress();
7374
} catch (IOException e) {
74-
Timber.d("Using remote address.");
75+
Log.d(TAG, "Using remote address.");
7576

7677
return serverRoute.getRemoteAddress();
7778
}

0 commit comments

Comments
 (0)