1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 09:39:39 +02:00

SMACK-534 Refactored all System.out/err and printStackTrace calls with appropriate Java util logging calls.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_4_0@13887 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2014-02-02 22:39:07 +00:00
parent 9bb940da4b
commit 1b651d4939
30 changed files with 189 additions and 183 deletions

View file

@ -29,6 +29,8 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.packet.Authentication;
@ -57,7 +59,8 @@ import org.xmlpull.v1.XmlPullParserException;
* @author Gaston Dombiak
*/
public class PacketParserUtils {
private static Logger logger = Logger.getLogger(PacketParserUtils.class.getName());
/**
* Namespace used to store packet properties.
*/
@ -198,7 +201,7 @@ public class PacketParserUtils {
type = Presence.Type.valueOf(typeString);
}
catch (IllegalArgumentException iae) {
System.err.println("Found invalid presence type " + typeString);
logger.warning("Found invalid presence type " + typeString);
}
}
Presence presence = new Presence(type);
@ -242,7 +245,7 @@ public class PacketParserUtils {
presence.setMode(Presence.Mode.valueOf(modeText));
}
catch (IllegalArgumentException iae) {
System.err.println("Found invalid presence mode " + modeText);
logger.warning("Found invalid presence mode " + modeText);
}
}
else if (elementName.equals("error")) {
@ -263,7 +266,7 @@ public class PacketParserUtils {
presence.addExtension(PacketParserUtils.parsePacketExtension(elementName, namespace, parser));
}
catch (Exception e) {
System.err.println("Failed to parse extension packet in Presence packet.");
logger.warning("Failed to parse extension packet in Presence packet.");
}
}
}
@ -639,7 +642,7 @@ public class PacketParserUtils {
value = in.readObject();
}
catch (Exception e) {
e.printStackTrace();
logger.log(Level.SEVERE, "Error parsing java object", e);
}
}
if (name != null && value != null) {
@ -782,8 +785,7 @@ public class PacketParserUtils {
}
}
catch (IllegalArgumentException iae) {
// Print stack trace. We shouldn't be getting an illegal error type.
iae.printStackTrace();
logger.log(Level.SEVERE, "Could not find error type for " + type.toUpperCase(), iae);
}
return new XMPPError(Integer.parseInt(errorCode), errorType, condition, message, extensions);
}