aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-10 04:50:07 +0700
committerGravatar Vitaly Takmazov2016-11-10 21:41:14 +0300
commit09221ab5695e99b2df1130ea923c39625ec85429 (patch)
tree58c775188d25239a1e32a83f8007e5f1679d49ee /juick-notifications/src
parent705d4f87c97dfa20eb6daa88b93ff124fa401b92 (diff)
using slf4j + logback for logging
Diffstat (limited to 'juick-notifications/src')
-rw-r--r--juick-notifications/src/main/java/com/juick/components/Notifications.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/Notifications.java b/juick-notifications/src/main/java/com/juick/components/Notifications.java
index 7bb81530..12993418 100644
--- a/juick-notifications/src/main/java/com/juick/components/Notifications.java
+++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java
@@ -41,6 +41,8 @@ import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.apache.http.util.TextUtils;
import org.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.env.Environment;
@@ -55,8 +57,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
-import java.util.logging.Level;
-import java.util.logging.Logger;
/**
*
@@ -64,7 +64,7 @@ import java.util.logging.Logger;
*/
public class Notifications implements DisposableBean, Stream.StreamListener, MessageListener {
- private static Logger logger = Logger.getLogger(Notifications.class.getName());
+ private static Logger logger = LoggerFactory.getLogger(Notifications.class);
String wns_application_sip;
String wns_client_secret;
@@ -101,7 +101,7 @@ public class Notifications implements DisposableBean, Stream.StreamListener, Mes
xmpp.addListener((Stream.StreamListener) this);
xmpp.addListener((MessageListener) this);
} catch (IOException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
+ logger.error(e.getMessage(), e);
}
}
@@ -111,7 +111,7 @@ public class Notifications implements DisposableBean, Stream.StreamListener, Mes
}
@Override
- public void onStreamFail(Exception e) {logger.log(Level.SEVERE, "XMPP STREAM FAIL", e);}
+ public void onStreamFail(Exception e) {logger.error("XMPP STREAM FAIL", e);}
@Override
public void onMessage(com.juick.xmpp.Message msg) {
@@ -144,9 +144,9 @@ public class Notifications implements DisposableBean, Stream.StreamListener, Mes
logger.info("RES " + i + ": " + results.get(i).toString());
}
} catch (IOException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
+ logger.error(e.getMessage(), e);
} catch (IllegalArgumentException err) {
- logger.warning("Android: Invalid API Key");
+ logger.warn("Android: Invalid API Key");
}
} else {
logger.info("GMS: no recipients");
@@ -188,13 +188,13 @@ public class Notifications implements DisposableBean, Stream.StreamListener, Mes
+ "<command arguments=\"?mid=" + jmsg.getMID() + "\" />"
+ "</commands>"
+ "</toast>";
- logger.fine(xml);
+ logger.trace(xml);
for (String url : urls) {
logger.info("WNS: " + url);
sendWNS(wnsToken, url, xml);
}
} catch (IOException | IllegalStateException e) {
- logger.log(Level.SEVERE, "WNS: ", e);
+ logger.error("WNS: ", e);
}
}