From dfcd2df6792944bc6dd6028d526896232b300cea Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 28 Oct 2018 14:13:12 +0000 Subject: [PATCH] Improve debug logging --- .../java/com/acmetensortoys/ctfwstimer/MainService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java index 6f327ca..313af23 100644 --- a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java +++ b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainService.java @@ -154,11 +154,14 @@ public class MainService extends Service { @Override public void onFailure(IMqttToken asyncActionToken, Throwable exception) { - Log.e("CtFws", "Conn Fail", exception); - if (asyncActionToken.getClient().equals(mMqc)) { + if (asyncActionToken.getClient().isConnected()) { + Log.d("CtFwS", "Spurious connection failure?", exception); + } + else if (asyncActionToken.getClient().equals(mMqc)) { + Log.e("CtFws", "Conn Fail", exception); setMSE(MqttServerEvent.MSE_DISCONN); } else { - Log.d("Service", "IS STALE DISCONN"); + Log.d("CtFwS", "Stale connection failure message"); } } }; -- 2.50.1