Use Timber for all logs

This commit is contained in:
moezbhatti
2019-06-09 23:53:51 -04:00
parent c4a49a73d5
commit e1c26d055c
59 changed files with 505 additions and 858 deletions
@@ -23,15 +23,14 @@ import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.widget.Toast;
import com.klinker.android.logger.Log;
import org.jetbrains.annotations.Nullable;
import timber.log.Timber;
/**
* @hide
*/
public final class SqliteWrapper {
private static final String TAG = "SqliteWrapper";
private static final String SQLITE_EXCEPTION_DETAIL_MESSAGE
= "unable to open database file";
@@ -59,7 +58,7 @@ public final class SqliteWrapper {
try {
return resolver.query(uri, projection, selection, selectionArgs, sortOrder);
} catch (SQLiteException e) {
Log.e(TAG, "Catch a SQLiteException when query: ", e);
Timber.e(e, "Catch a SQLiteException when query: ");
checkSQLiteException(context, e);
return null;
}
@@ -70,7 +69,7 @@ public final class SqliteWrapper {
try {
return resolver.update(uri, values, where, selectionArgs);
} catch (SQLiteException e) {
Log.e(TAG, "Catch a SQLiteException when update: ", e);
Timber.e(e, "Catch a SQLiteException when update: ");
checkSQLiteException(context, e);
return -1;
}
@@ -81,7 +80,7 @@ public final class SqliteWrapper {
try {
return resolver.delete(uri, where, selectionArgs);
} catch (SQLiteException e) {
Log.e(TAG, "Catch a SQLiteException when delete: ", e);
Timber.e(e, "Catch a SQLiteException when delete: ");
checkSQLiteException(context, e);
return -1;
}
@@ -92,7 +91,7 @@ public final class SqliteWrapper {
try {
return resolver.insert(uri, values);
} catch (SQLiteException e) {
Log.e(TAG, "Catch a SQLiteException when insert: ", e);
Timber.e(e, "Catch a SQLiteException when insert: ");
checkSQLiteException(context, e);
return null;
}
@@ -17,7 +17,7 @@
package android.net;
import android.text.TextUtils;
import com.klinker.android.logger.Log;
import timber.log.Timber;
import java.net.Inet4Address;
import java.net.InetAddress;
@@ -32,7 +32,6 @@ import java.util.Collections;
* @hide
*/
public class DhcpInfoInternal {
private final static String TAG = "DhcpInfoInternal";
public String ipAddress;
public int prefixLength;
@@ -96,7 +95,7 @@ public class DhcpInfoInternal {
public LinkAddress makeLinkAddress() {
if (TextUtils.isEmpty(ipAddress)) {
Log.e(TAG, "makeLinkAddress with empty ipAddress");
Timber.e("makeLinkAddress with empty ipAddress");
return null;
}
return new LinkAddress(NetworkUtilsHelper.numericToInetAddress(ipAddress), prefixLength);
@@ -112,12 +111,12 @@ public class DhcpInfoInternal {
if (TextUtils.isEmpty(dns1) == false) {
p.addDns(NetworkUtilsHelper.numericToInetAddress(dns1));
} else {
Log.d(TAG, "makeLinkProperties with empty dns1!");
Timber.d("makeLinkProperties with empty dns1!");
}
if (TextUtils.isEmpty(dns2) == false) {
p.addDns(NetworkUtilsHelper.numericToInetAddress(dns2));
} else {
Log.d(TAG, "makeLinkProperties with empty dns2!");
Timber.d("makeLinkProperties with empty dns2!");
}
return p;
}
@@ -18,7 +18,7 @@ package android.net;
import android.os.Parcel;
import android.os.Parcelable;
import com.klinker.android.logger.Log;
import timber.log.Timber;
import java.util.Collection;
import java.util.HashMap;
@@ -32,7 +32,6 @@ import java.util.Set;
* @hide
*/
public class LinkCapabilities implements Parcelable {
private static final String TAG = "LinkCapabilities";
private static final boolean DBG = false;
/**
@@ -388,6 +387,6 @@ public class LinkCapabilities implements Parcelable {
* Debug logging
*/
protected static void log(String s) {
Log.d(TAG, s);
Timber.d(s);
}
}
@@ -16,7 +16,7 @@
package android.net;
import com.klinker.android.logger.Log;
import timber.log.Timber;
import java.net.Inet4Address;
import java.net.Inet6Address;
@@ -31,8 +31,6 @@ import java.util.Collection;
*/
public class NetworkUtilsHelper {
private static final String TAG = "NetworkUtils";
/**
* Bring the named network interface up.
*/
@@ -255,7 +253,7 @@ public class NetworkUtilsHelper {
addrHexString.substring(16, 20), addrHexString.substring(20, 24),
addrHexString.substring(24, 28), addrHexString.substring(28, 32)));
} catch (Exception e) {
Log.e("NetworkUtils", "error in hexToInet6Address(" + addrHexString + "): " + e);
Timber.e("error in hexToInet6Address(" + addrHexString + "): " + e);
throw new IllegalArgumentException(e);
}
}
@@ -18,7 +18,7 @@ package android.net;
import android.os.Parcel;
import android.os.Parcelable;
import com.klinker.android.logger.Log;
import timber.log.Timber;
import java.net.Inet4Address;
import java.net.Inet6Address;
@@ -32,7 +32,6 @@ import java.util.Collection;
* @hide
*/
public class RouteInfo implements Parcelable {
private static final String TAG = "RouteInfo";
/**
* The IP destination address for this route.
*/
@@ -54,14 +53,14 @@ public class RouteInfo implements Parcelable {
destination = new LinkAddress(Inet4Address.getLocalHost(), 0);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
Log.e(TAG, "exception thrown", e);
Timber.e(e, "exception thrown");
}
} else {
try {
destination = new LinkAddress(Inet6Address.getLocalHost(), 0);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
Log.e(TAG, "exception thrown", e);
Timber.e(e, "exception thrown");
}
}
} else {
@@ -75,14 +74,14 @@ public class RouteInfo implements Parcelable {
gateway = Inet4Address.getLocalHost();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
Log.e(TAG, "exception thrown", e);
Timber.e(e, "exception thrown");
}
} else {
try {
gateway = Inet6Address.getLocalHost();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
Log.e(TAG, "exception thrown", e);
Timber.e(e, "exception thrown");
}
}
}