diff options
author | 2016-01-26 21:43:38 +0300 | |
---|---|---|
committer | 2016-01-26 21:43:38 +0300 | |
commit | 58fb4a6394cb19ee04e65d0e921cdf0ae6fdb6e3 (patch) | |
tree | 63e50cebe6e2fb900cc3297f5e2af09a7169fc95 /src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java | |
parent | e5dba294763f40a5e3fd8e997d4ea3f507142924 (diff) |
s2s: logging
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java')
-rw-r--r-- | src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java b/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java index d8ce0daf..4a1f6b16 100644 --- a/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java +++ b/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java @@ -26,7 +26,7 @@ public class ConnectionRouter extends Connection implements Runnable { @Override public void run() { - System.out.println("STREAM ROUTER START"); + LOGGER.info("STREAM ROUTER START"); try { socket = new Socket("localhost", 5347); @@ -53,7 +53,7 @@ public class ConnectionRouter extends Connection implements Runnable { throw new Exception("NO HANDSHAKE"); } XmlUtils.skip(parser); - System.out.println("STREAM ROUTER OPEN"); + LOGGER.info("STREAM ROUTER OPEN"); while (parser.next() != XmlPullParser.END_DOCUMENT) { if (parser.getEventType() != XmlPullParser.START_TAG) { @@ -68,7 +68,7 @@ public class ConnectionRouter extends Connection implements Runnable { if (jid.Host.equals(XMPPComponent.COMPONENTNAME)) { if (tag.equals("message")) { Message xmsg = Message.parse(parser, XMPPComponent.childParsers); - System.out.println("STREAM ROUTER (PROCESS): " + xmsg.toString()); + LOGGER.info("STREAM ROUTER (PROCESS): " + xmsg.toString()); JuickMessage jmsg = (JuickMessage) xmsg.getChild(JuickMessage.XMLNS); if (jmsg != null) { if (jid.Username != null && jid.Username.equals("recomm")) { @@ -84,23 +84,23 @@ public class ConnectionRouter extends Connection implements Runnable { } } else if (jid.Host.endsWith(XMPPComponent.HOSTNAME) && (jid.Host.equals(XMPPComponent.HOSTNAME) || jid.Host.endsWith("." + XMPPComponent.HOSTNAME))) { String xml = XmlUtils.parseToString(parser, true); - System.out.println("STREAM ROUTER: " + xml); + LOGGER.info("STREAM ROUTER: " + xml); } else { String xml = XmlUtils.parseToString(parser, true); - System.out.println("STREAM ROUTER (OUT): " + xml); + LOGGER.info("STREAM ROUTER (OUT): " + xml); XMPPComponent.sendOut(jid.Host, xml); } } else { - System.out.println("STREAM ROUTER (NO TO): " + XmlUtils.parseToString(parser, true)); + LOGGER.info("STREAM ROUTER (NO TO): " + XmlUtils.parseToString(parser, true)); } } else { - System.out.println("STREAM ROUTER: " + XmlUtils.parseToString(parser, true)); + LOGGER.info("STREAM ROUTER: " + XmlUtils.parseToString(parser, true)); } } - System.err.println("STREAM ROUTER FINISHED"); + LOGGER.warning("STREAM ROUTER FINISHED"); } catch (Exception e) { - System.err.println("STREAM ROUTER PARSE ERROR: " + e.toString()); + LOGGER.warning("STREAM ROUTER PARSE ERROR: " + e.toString()); } System.exit(0); } @@ -111,8 +111,8 @@ public class ConnectionRouter extends Connection implements Runnable { writer.write(xml); writer.flush(); } catch (IOException e) { - System.err.println("STREAM ROUTER ERROR: " + xml); - System.err.println("STREAM ROUTER ERROR: " + e.toString()); + LOGGER.warning("STREAM ROUTER ERROR: " + xml); + LOGGER.warning("STREAM ROUTER ERROR: " + e.toString()); System.exit(0); } } |