diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-11-20 22:41:30 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-11-20 22:41:30 +0100 |
commit | 2531c88f2c8a992aa0c40c9f96e88099dc94139e (patch) | |
tree | e3815b7f1ef0bbd227df8c4452d4aa52b54830e4 /src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java | |
parent | 8838a5094812e0540ccfef3334e49e1a5c1a564b (diff) |
Implements FS#67: Introduce central logging class to use log prefix, new activity to show logcat output and button to copy contents
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java b/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java index c9ee53ae..11091c9f 100644 --- a/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java +++ b/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java @@ -14,7 +14,7 @@ import java.security.spec.InvalidKeySpecException; import org.json.JSONException; import org.json.JSONObject; -import android.util.Log; +import de.thedevstack.conversationsplus.utils.Logging; import de.thedevstack.conversationsplus.Config; import de.thedevstack.conversationsplus.ConversationsPlusPreferences; @@ -111,7 +111,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { mXmppConnectionService.updateConversationUi(); } } catch (InvalidJidException e) { - Log.d(Config.LOGTAG,account.getJid().toBareJid()+": smp in invalid session "+id.toString()); + Logging.d(Config.LOGTAG,account.getJid().toBareJid()+": smp in invalid session "+id.toString()); } } @@ -152,7 +152,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { this.saveKey(); mXmppConnectionService.databaseBackend.updateAccount(account); } catch (NoSuchAlgorithmException e) { - Log.d(Config.LOGTAG, + Logging.d(Config.LOGTAG, "error generating key pair " + e.getMessage()); } } @@ -221,7 +221,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { @Override public void showError(SessionID arg0, String arg1) throws OtrException { - Log.d(Config.LOGTAG,"show error"); + Logging.d(Config.LOGTAG,"show error"); } @Override @@ -256,7 +256,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { @Override public void unreadableMessageReceived(SessionID session) throws OtrException { - Log.d(Config.LOGTAG,"unreadable message received"); + Logging.d(Config.LOGTAG,"unreadable message received"); sendOtrErrorMessage(session, "You sent me an unreadable OTR-encrypted message"); } @@ -270,8 +270,8 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { .generateOtrError(jid, id, errorText); packet.setFrom(account.getJid()); mXmppConnectionService.sendMessagePacket(account,packet); - Log.d(Config.LOGTAG,packet.toString()); - Log.d(Config.LOGTAG,account.getJid().toBareJid().toString() + Logging.d(Config.LOGTAG,packet.toString()); + Logging.d(Config.LOGTAG,account.getJid().toBareJid().toString() +": unreadable OTR message in "+conversation.getName()); } } catch (InvalidJidException e) { @@ -286,7 +286,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { @Override public void verify(SessionID id, String fingerprint, boolean approved) { - Log.d(Config.LOGTAG,"OtrService.verify("+id.toString()+","+fingerprint+","+String.valueOf(approved)+")"); + Logging.d(Config.LOGTAG,"OtrService.verify("+id.toString()+","+fingerprint+","+String.valueOf(approved)+")"); try { final Jid jid = Jid.fromSessionID(id); Conversation conversation = this.mXmppConnectionService.find(this.account,jid); |