1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +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

@ -27,6 +27,8 @@ import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* A Time IQ packet, which is used by XMPP clients to exchange their respective local
@ -61,7 +63,8 @@ import java.util.TimeZone;
* @author Matt Tucker
*/
public class Time extends IQ {
private static Logger log = Logger.getLogger(Time.class.getName());
private static SimpleDateFormat utcFormat = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
private static DateFormat displayFormat = DateFormat.getDateTimeInstance();
@ -94,7 +97,7 @@ public class Time extends IQ {
/**
* Returns the local time or <tt>null</tt> if the time hasn't been set.
*
* @return the lcocal time.
* @return the local time.
*/
public Date getTime() {
if (utc == null) {
@ -109,7 +112,7 @@ public class Time extends IQ {
date = cal.getTime();
}
catch (Exception e) {
e.printStackTrace();
log.log(Level.SEVERE, "Error getting local time", e);
}
return date;
}

View file

@ -33,6 +33,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.PacketCollector;
@ -85,6 +87,8 @@ import org.jivesoftware.smack.util.StringUtils;
* @author Kirill Maximov (kir@maxkir.com)
*/
public class VCard extends IQ {
private static Logger log = Logger.getLogger(VCard.class.getName());
private static final String DEFAULT_MIME_TYPE = "image/jpeg";
/**
@ -332,7 +336,7 @@ public class VCard extends IQ {
bytes = getBytes(avatarURL);
}
catch (IOException e) {
e.printStackTrace();
log.log(Level.SEVERE, "Error getting bytes from URL: " + avatarURL, e);
}
setAvatar(bytes);
@ -489,7 +493,7 @@ public class VCard extends IQ {
digest = MessageDigest.getInstance("SHA-1");
}
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
log.log(Level.SEVERE, "Failed to get message digest", e);
return null;
}
@ -582,7 +586,7 @@ public class VCard extends IQ {
result = (VCard) packet;
}
catch (ClassCastException e) {
System.out.println("No VCard for " + user);
log.log(Level.SEVERE, "No VCard for " + user, e);
return;
}