From 2531c88f2c8a992aa0c40c9f96e88099dc94139e Mon Sep 17 00:00:00 2001 From: steckbrief Date: Fri, 20 Nov 2015 22:41:30 +0100 Subject: Implements FS#67: Introduce central logging class to use log prefix, new activity to show logcat output and button to copy contents --- .../de/thedevstack/conversationsplus/parser/AbstractParser.java | 4 ++-- .../java/de/thedevstack/conversationsplus/parser/IqParser.java | 6 +++--- .../de/thedevstack/conversationsplus/parser/MessageParser.java | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/parser') diff --git a/src/main/java/de/thedevstack/conversationsplus/parser/AbstractParser.java b/src/main/java/de/thedevstack/conversationsplus/parser/AbstractParser.java index 87238f9e..c9efe3d7 100644 --- a/src/main/java/de/thedevstack/conversationsplus/parser/AbstractParser.java +++ b/src/main/java/de/thedevstack/conversationsplus/parser/AbstractParser.java @@ -61,10 +61,10 @@ public abstract class AbstractParser { */ public static Date parseTimestamp(String timestamp) throws ParseException { /*try { - Log.d("TIMESTAMP", timestamp); + Logging.d("TIMESTAMP", timestamp); return DatatypeFactory.newInstance().newXMLGregorianCalendar(timestamp).toGregorianCalendar().getTime(); } catch (DatatypeConfigurationException e) { - Log.d("TIMESTAMP", e.getMessage()); + Logging.d("TIMESTAMP", e.getMessage()); return new Date(); }*/ timestamp = timestamp.replace("Z", "+0000"); diff --git a/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java b/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java index f76dbf03..88091366 100644 --- a/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java +++ b/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java @@ -1,6 +1,6 @@ package de.thedevstack.conversationsplus.parser; -import android.util.Log; +import de.thedevstack.conversationsplus.utils.Logging; import java.util.ArrayList; import java.util.Collection; @@ -83,7 +83,7 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { } else if ((packet.hasChild("block", Xmlns.BLOCKING) || packet.hasChild("blocklist", Xmlns.BLOCKING)) && packet.fromServer(account)) { // Block list or block push. - Log.d(Config.LOGTAG, "Received blocklist update from server"); + Logging.d(Config.LOGTAG, "Received blocklist update from server"); final Element blocklist = packet.findChild("blocklist", Xmlns.BLOCKING); final Element block = packet.findChild("block", Xmlns.BLOCKING); final Collection items = blocklist != null ? blocklist.getChildren() : @@ -111,7 +111,7 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { mXmppConnectionService.updateBlocklistUi(OnUpdateBlocklist.Status.BLOCKED); } else if (packet.hasChild("unblock", Xmlns.BLOCKING) && packet.fromServer(account) && packet.getType() == IqPacket.TYPE.SET) { - Log.d(Config.LOGTAG, "Received unblock update from server"); + Logging.d(Config.LOGTAG, "Received unblock update from server"); final Collection items = packet.findChild("unblock", Xmlns.BLOCKING).getChildren(); if (items.size() == 0) { // No children to unblock == unblock all diff --git a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java index f346eafc..6f8ad2fe 100644 --- a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java +++ b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java @@ -1,6 +1,6 @@ package de.thedevstack.conversationsplus.parser; -import android.util.Log; +import de.thedevstack.conversationsplus.utils.Logging; import android.util.Pair; import net.java.otr4j.session.Session; @@ -219,7 +219,7 @@ public class MessageParser extends AbstractParser implements serverMsgId = result.getAttribute("id"); query.incrementTotalCount(); } else if (query != null) { - Log.d(Config.LOGTAG,account.getJid().toBareJid()+": received mam result from invalid sender"); + Logging.d(Config.LOGTAG,account.getJid().toBareJid()+": received mam result from invalid sender"); return; } else if (original.fromServer(account)) { Pair f; @@ -249,7 +249,7 @@ public class MessageParser extends AbstractParser implements final String remoteMsgId = packet.getId(); if (from == null || to == null) { - Log.d(Config.LOGTAG,"no to or from in: "+packet.toString()); + Logging.d(Config.LOGTAG,"no to or from in: "+packet.toString()); return; } @@ -323,7 +323,7 @@ public class MessageParser extends AbstractParser implements || (isTypeGroupChat && packet.hasChild("delay","urn:xmpp:delay")) || message.getType() == Message.TYPE_PRIVATE; if (checkForDuplicates && conversation.hasDuplicateMessage(message)) { - Log.d(Config.LOGTAG,"skipping duplicate message from "+message.getCounterpart().toString()+" "+message.getBody()); + Logging.d(Config.LOGTAG,"skipping duplicate message from "+message.getCounterpart().toString()+" "+message.getBody()); return; } if (query != null) { -- cgit v1.2.3