1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 01:29:38 +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

@ -37,6 +37,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
/**
* Manges information about the agents in a workgroup and their presence.
@ -45,7 +46,7 @@ import java.util.Set;
* @see AgentSession#getAgentRoster()
*/
public class AgentRoster {
private static Logger log = Logger.getLogger(AgentRoster.class.getName());
private static final int EVENT_AGENT_ADDED = 0;
private static final int EVENT_AGENT_REMOVED = 1;
private static final int EVENT_PRESENCE_CHANGED = 2;
@ -284,7 +285,7 @@ public class AgentRoster {
String from = presence.getFrom();
if (from == null) {
// TODO Check if we need to ignore these presences or this is a server bug?
System.out.println("Presence with no FROM: " + presence.toXML());
log.warning("Presence with no FROM: " + presence.toXML());
return;
}
String key = getPresenceMapKey(from);

View file

@ -40,6 +40,8 @@ import org.jivesoftware.smackx.ReportedData;
import org.jivesoftware.smackx.packet.MUCUser;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* This class embodies the agent's active presence within a given workgroup. The application
@ -53,7 +55,8 @@ import java.util.*;
* @author Derek DeMoro
*/
public class AgentSession {
private static Logger log = Logger.getLogger(AgentSession.class.getName());
private Connection connection;
private String workgroupJID;
@ -118,7 +121,7 @@ public class AgentSession {
handlePacket(packet);
}
catch (Exception e) {
e.printStackTrace();
log.log(Level.SEVERE, "Error processing packet", e);
}
}
};

View file

@ -29,13 +29,15 @@ import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.logging.Logger;
/**
* Queue details packet extension, which contains details about the users
* currently in a queue.
*/
public class QueueDetails implements PacketExtension {
private static Logger log = Logger.getLogger(QueueDetails.class.getName());
/**
* Element name of the packet extension.
*/
@ -178,7 +180,7 @@ public class QueueDetails implements PacketExtension {
}
else if( parser.getName().equals( "waitTime" ) ) {
Date wait = dateFormat.parse(parser.nextText());
System.out.println( wait );
log.fine(wait.toString());
}
eventType = parser.next();

View file

@ -849,20 +849,4 @@ public class Workgroup {
}
return Form.getFormFrom(response);
}
/*
public static void main(String args[]) throws Exception {
Connection con = new XMPPConnection("anteros");
con.connect();
con.loginAnonymously();
Workgroup workgroup = new Workgroup("demo@workgroup.anteros", con);
WorkgroupProperties props = workgroup.getWorkgroupProperties("derek@anteros.com");
System.out.print(props);
con.disconnect();
}
*/
}

View file

@ -19,6 +19,8 @@ package org.jivesoftware.smackx.workgroup.util;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.ListIterator;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* This class is a very flexible event dispatcher which implements Runnable so that it can
@ -32,8 +34,8 @@ import java.util.ListIterator;
*
* @author loki der quaeler
*/
public class ListenerEventDispatcher
implements Runnable {
public class ListenerEventDispatcher implements Runnable {
private static Logger log = Logger.getLogger(ListenerEventDispatcher.class.getName());
protected transient ArrayList<TripletContainer> triplets;
@ -93,9 +95,7 @@ public class ListenerEventDispatcher
try {
tc.getListenerMethod().invoke(tc.getListenerInstance(), tc.getMethodArguments());
} catch (Exception e) {
System.err.println("Exception dispatching an event: " + e);
e.printStackTrace();
log.log(Level.SEVERE, "Exception dispatching an event", e);
}
}