diff options
author | Vitaly Takmazov | 2016-01-03 10:13:34 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-01-03 10:13:34 +0300 |
commit | be5c5b0ec0574ff13f4ff2ecd7fb10490bfecbe2 (patch) | |
tree | 92c8755d7db7275900918c55e2313df9ccd2f7d1 | |
parent | 3977558af5ec48fd84ecb79d3acad3f13763e154 (diff) |
fix logging
-rw-r--r-- | build.gradle | 1 | ||||
-rw-r--r-- | src/main/java/com/juick/PushComponent.java | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/build.gradle b/build.gradle index cadcc22e..0ab1e759 100644 --- a/build.gradle +++ b/build.gradle @@ -57,6 +57,7 @@ dependencies { compile server compile xmpp compile json + compile 'org.slf4j:slf4j-jdk14:1.7.13' compile 'com.ganyo:gcm-server:1.0.+' compile 'com.notnoop.apns:apns:1.0.0.Beta6' compile 'com.github.scribejava:scribejava-apis:2.0.1' diff --git a/src/main/java/com/juick/PushComponent.java b/src/main/java/com/juick/PushComponent.java index 2102f77d..6fccce1e 100644 --- a/src/main/java/com/juick/PushComponent.java +++ b/src/main/java/com/juick/PushComponent.java @@ -209,13 +209,15 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe MulticastResult result = GCMSender.send(message, regids, 3); List<Result> results = result.getResults(); for (int i = 0; i < results.size(); i++) { - logger.fine("RES " + i + ": " + results.get(i).toString()); + logger.info("RES " + i + ": " + results.get(i).toString()); } } catch (IOException e) { logger.log(Level.SEVERE, e.getMessage(), e); } catch (IllegalArgumentException err) { logger.warning("Android: Invalid API Key"); } + } else { + logger.info("GMS: no recipients"); } /*** WinPhone ***/ @@ -252,10 +254,13 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe logger.fine(xml); for (int i = 0; i < urls.size(); i++) { String url = urls.get(i); - logger.fine("WNS: " + url); + logger.info("WNS: " + url); sendWNS(url, xml); } + } else { + logger.info("WNS: no recipients"); } + /*** iOS ***/ List<String> tokens; @@ -273,9 +278,11 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe .withSandboxDestination().build(); for (String token : tokens) { String payload = APNS.newPayload().alertTitle("@" + jmsg.User.UName).alertBody(jmsg.Text).build(); - logger.fine("APNS: " + token); + logger.info("APNS: " + token); service.push(token, payload); } + } else { + logger.info("APNS: no recipients"); } } |