aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-09-15 23:06:15 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-09-15 23:06:15 +0200
commit326834fd581861e0f8056eb0a5de8205088e7f09 (patch)
tree80c6c3de548085f1e433b8fcf2e2a2d661657d0c /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
parent3cd54581c33b20a9bfa55f767b245fc6e56e83ef (diff)
downloadopen-keychain-326834fd581861e0f8056eb0a5de8205088e7f09.tar.gz
open-keychain-326834fd581861e0f8056eb0a5de8205088e7f09.tar.bz2
open-keychain-326834fd581861e0f8056eb0a5de8205088e7f09.zip
mime: add logging to InputDataOperation
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
index 3856209b3..69e7d3d2d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java
@@ -126,6 +126,13 @@ public abstract class OperationResult implements Parcelable {
Log.v(Constants.TAG, "log: " + this);
}
+ /** Clones this LogEntryParcel, adding extra indent. Note that the parameter array is NOT cloned! */
+ public LogEntryParcel (LogEntryParcel original, int extraIndent) {
+ mType = original.mType;
+ mParameters = original.mParameters;
+ mIndent = original.mIndent +extraIndent;
+ }
+
public LogEntryParcel(Parcel source) {
mType = LogType.values()[source.readInt()];
mParameters = (Object[]) source.readSerializable();
@@ -818,10 +825,19 @@ public abstract class OperationResult implements Parcelable {
MSG_KEYBASE_ERROR_PAYLOAD_MISMATCH(LogLevel.ERROR,
R.string.msg_keybase_error_msg_payload_mismatch),
- // mime parsing
- MSG_MIME_PARSING(LogLevel.START,R.string.msg_mime_parsing_start),
- MSG_MIME_PARSING_ERROR(LogLevel.ERROR,R.string.msg_mime_parsing_error),
- MSG_MIME_PARSING_SUCCESS(LogLevel.OK,R.string.msg_mime_parsing_success),
+ // InputData Operation
+ MSG_DATA (LogLevel.START, R.string.msg_data),
+ MSG_DATA_DECRYPT (LogLevel.DEBUG, R.string.msg_data_decrypt),
+ MSG_DATA_ERROR_IO (LogLevel.ERROR, R.string.msg_data_error_io),
+ MSG_DATA_MIME_ERROR (LogLevel.ERROR, R.string.msg_data_mime_error),
+ MSG_DATA_MIME_FILENAME (LogLevel.DEBUG, R.string.msg_data_mime_filename),
+ MSG_DATA_MIME_LENGTH (LogLevel.DEBUG, R.string.msg_data_mime_length),
+ MSG_DATA_MIME (LogLevel.DEBUG, R.string.msg_data_mime),
+ MSG_DATA_MIME_OK (LogLevel.INFO, R.string.msg_data_mime_ok),
+ MSG_DATA_MIME_PART (LogLevel.DEBUG, R.string.msg_data_mime_part),
+ MSG_DATA_MIME_TYPE (LogLevel.DEBUG, R.string.msg_data_mime_type),
+ MSG_DATA_OK (LogLevel.OK, R.string.msg_data_ok),
+ MSG_DATA_SKIP_MIME (LogLevel.DEBUG, R.string.msg_data_skip_mime),
MSG_LV (LogLevel.START, R.string.msg_lv),
MSG_LV_MATCH (LogLevel.DEBUG, R.string.msg_lv_match),
@@ -901,6 +917,13 @@ public abstract class OperationResult implements Parcelable {
mParcels.add(new SubLogEntryParcel(subResult, subLog.getFirst().mType, indent, subLog.getFirst().mParameters));
}
+ public void addByMerge(OperationResult subResult, int indent) {
+ OperationLog subLog = subResult.getLog();
+ for (LogEntryParcel entry : subLog) {
+ mParcels.add(new LogEntryParcel(entry, indent));
+ }
+ }
+
public SubLogEntryParcel getSubResultIfSingle() {
if (mParcels.size() != 1) {
return null;