add logging

This commit is contained in:
Vincent Breitmoser
2017-09-23 01:22:36 +02:00
parent a6f97cf46e
commit bf31d4f55d
5 changed files with 40 additions and 11 deletions

View File

@@ -95,10 +95,9 @@ public class DeleteOperation extends BaseReadWriteOperation<DeleteKeyringParcel>
}
if (isSecret && success > 0) {
log.add(LogType.MSG_DEL_CONSOLIDATE, 1);
UpdateTrustResult sub = mKeyWritableRepository.updateTrustDb(
Collections.singletonList(masterKeyIds[0]), mProgressable);
// log.add(sub, 2);
log.add(sub, 1);
}
int result = DeleteResult.RESULT_OK;

View File

@@ -264,11 +264,10 @@ public class ImportOperation extends BaseReadWriteOperation<ImportKeyringParcel>
// and re-inserts keys, which could conflict with a parallel db key update
if (!skipSave && !secretMasterKeyIds.isEmpty()) {
setPreventCancel();
UpdateTrustResult result;
synchronized (mKeyRepository) {
result = mKeyWritableRepository.updateTrustDb(secretMasterKeyIds, progressable);
UpdateTrustResult result = mKeyWritableRepository.updateTrustDb(secretMasterKeyIds, progressable);
log.add(result, 1);
}
// log.add(result, 1);
}
// Special: make sure new data is synced into contacts

View File

@@ -798,9 +798,8 @@ public abstract class OperationResult implements Parcelable {
MSG_DEL_ERROR_EMPTY (LogLevel.ERROR, R.string.msg_del_error_empty),
MSG_DEL_ERROR_MULTI_SECRET (LogLevel.ERROR, R.string.msg_del_error_multi_secret),
MSG_DEL (LogLevel.START, R.plurals.msg_del),
MSG_DEL_KEY (LogLevel.DEBUG, R.string.msg_del_key),
MSG_DEL_KEY (LogLevel.INFO, R.string.msg_del_key),
MSG_DEL_KEY_FAIL (LogLevel.WARN, R.string.msg_del_key_fail),
MSG_DEL_CONSOLIDATE (LogLevel.DEBUG, R.string.msg_del_consolidate),
MSG_DEL_OK (LogLevel.OK, R.plurals.msg_del_ok),
MSG_DEL_FAIL (LogLevel.WARN, R.plurals.msg_del_fail),
@@ -910,6 +909,12 @@ public abstract class OperationResult implements Parcelable {
MSG_RET_URI_NULL (LogLevel.ERROR, R.string.msg_ret_uri_null),
MSG_RET_URI_TEST (LogLevel.DEBUG, R.string.msg_ret_uri_test),
MSG_TRUST (LogLevel.START, R.string.msg_trust),
MSG_TRUST_OK (LogLevel.OK, R.string.msg_trust_ok),
MSG_TRUST_KEY (LogLevel.INFO, R.string.msg_trust_key),
MSG_TRUST_INITIALIZE (LogLevel.INFO, R.string.msg_trust_initialize),
MSG_TRUST_COUNT_NONE (LogLevel.DEBUG, R.string.msg_trust_count_none),
MSG_TRUST_COUNT (LogLevel.DEBUG, R.plurals.msg_trust_count);
;
public final int mMsgId;