0
0
mirror of https://github.com/thunderbird/thunderbird-android.git synced 2024-09-19 19:52:14 +02:00

Use Timber for logging

This commit is contained in:
cketti 2021-11-26 15:52:11 +01:00
parent 878400c15f
commit a3033d1983
3 changed files with 14 additions and 17 deletions

View File

@ -1526,7 +1526,7 @@ public class MessagingController {
OutboxState outboxState = outboxStateRepository.getOutboxState(messageId);
if (outboxState.getSendState() != SendState.READY) {
Timber.v("Skipping sending message " + message.getUid());
Timber.v("Skipping sending message %s", message.getUid());
notificationController.showSendFailedNotification(account,
new MessagingException(message.getSubject()));
continue;

View File

@ -25,23 +25,20 @@ import java.util.concurrent.atomic.AtomicInteger;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import org.openintents.openpgp.IOpenPgpService2;
import org.openintents.openpgp.OpenPgpError;
import org.openintents.openpgp.util.ParcelFileDescriptorUtil.DataSinkTransferThread;
import org.openintents.openpgp.util.ParcelFileDescriptorUtil.DataSourceTransferThread;
import timber.log.Timber;
public class OpenPgpApi {
public static final String TAG = "OpenPgp API";
public static final String SERVICE_INTENT_2 = "org.openintents.openpgp.IOpenPgpService2";
/**
@ -478,7 +475,7 @@ public class OpenPgpApi {
pumpThread.join();
return new OpenPgpDataResult<>(result, pumpThread.getResult());
} catch (Exception e) {
Log.e(OpenPgpApi.TAG, "Exception in executeApi call", e);
Timber.e(e, "Exception in executeApi call");
Intent result = new Intent();
result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
result.putExtra(RESULT_ERROR,
@ -515,7 +512,7 @@ public class OpenPgpApi {
return result;
} catch (Exception e) {
Log.e(OpenPgpApi.TAG, "Exception in executeApi call", e);
Timber.e(e, "Exception in executeApi call");
Intent result = new Intent();
result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
result.putExtra(RESULT_ERROR,
@ -600,7 +597,7 @@ public class OpenPgpApi {
return result;
} catch (Exception e) {
Log.e(OpenPgpApi.TAG, "Exception in executeApi call", e);
Timber.e(e, "Exception in executeApi call");
Intent result = new Intent();
result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
result.putExtra(RESULT_ERROR,
@ -629,7 +626,7 @@ public class OpenPgpApi {
return result;
} catch (Exception e) {
Log.e(OpenPgpApi.TAG, "Exception in executeApi call", e);
Timber.e(e, "Exception in executeApi call");
Intent result = new Intent();
result.putExtra(RESULT_CODE, RESULT_CODE_ERROR);
result.putExtra(RESULT_ERROR,
@ -646,7 +643,7 @@ public class OpenPgpApi {
try {
input.close();
} catch (IOException e) {
Log.e(OpenPgpApi.TAG, "IOException when closing ParcelFileDescriptor!", e);
Timber.e(e, "IOException when closing ParcelFileDescriptor!");
}
}
}

View File

@ -27,10 +27,10 @@ import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor.AutoCloseInputStream;
import android.system.ErrnoException;
import android.system.OsConstants;
import android.util.Log;
import org.openintents.openpgp.util.OpenPgpApi.OpenPgpDataSink;
import org.openintents.openpgp.util.OpenPgpApi.OpenPgpDataSource;
import timber.log.Timber;
public class ParcelFileDescriptorUtil {
@ -77,7 +77,7 @@ public class ParcelFileDescriptorUtil {
mOut.write(buf, 0, len);
}
} catch (IOException e) {
Log.e(OpenPgpApi.TAG, "IOException when writing to out", e);
Timber.e(e, "IOException when writing to out");
} finally {
try {
mIn.close();
@ -116,11 +116,11 @@ public class ParcelFileDescriptorUtil {
dataSource.writeTo(outputStream);
} catch (IOException e) {
if (dataSource.isCancelled()) {
Log.d(OpenPgpApi.TAG, "Stopped writing because operation was cancelled.");
Timber.d("Stopped writing because operation was cancelled.");
} else if (isIOExceptionCausedByEPIPE(e)) {
Log.d(OpenPgpApi.TAG, "Stopped writing due to broken pipe (other end closed pipe?)");
Timber.d("Stopped writing due to broken pipe (other end closed pipe?)");
} else {
Log.e(OpenPgpApi.TAG, "IOException when writing to out", e);
Timber.e(e, "IOException when writing to out");
}
} finally {
try {
@ -154,9 +154,9 @@ public class ParcelFileDescriptorUtil {
sinkResult = dataSink.processData(inputStream);
} catch (IOException e) {
if (isIOExceptionCausedByEPIPE(e)) {
Log.e(OpenPgpApi.TAG, "Stopped read due to broken pipe (other end closed pipe?)");
Timber.e("Stopped read due to broken pipe (other end closed pipe?)");
} else {
Log.e(OpenPgpApi.TAG, "IOException while reading from in", e);
Timber.e(e, "IOException while reading from in");
}
sinkResult = null;
} finally {