mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49: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:
parent
9bb940da4b
commit
1b651d4939
30 changed files with 189 additions and 183 deletions
|
@ -52,6 +52,8 @@ import java.io.Writer;
|
|||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* The EnhancedDebugger is a debugger that allows to debug sent, received and interpreted messages
|
||||
|
@ -64,6 +66,8 @@ import java.util.Date;
|
|||
*/
|
||||
public class EnhancedDebugger implements SmackDebugger {
|
||||
|
||||
private static Logger log = Logger.getLogger(EnhancedDebugger.class.getName());
|
||||
|
||||
private static final String NEWLINE = "\n";
|
||||
|
||||
private static ImageIcon packetReceivedIcon;
|
||||
|
@ -427,7 +431,7 @@ public class EnhancedDebugger implements SmackDebugger {
|
|||
receivedText.replaceRange("", 0, receivedText.getLineEndOffset(0));
|
||||
}
|
||||
catch (BadLocationException e) {
|
||||
e.printStackTrace();
|
||||
log.log(Level.SEVERE, "Error with line offset, MAX_TABLE_ROWS is set too low: " + EnhancedDebuggerWindow.MAX_TABLE_ROWS, e);
|
||||
}
|
||||
}
|
||||
receivedText.append(str.substring(0, index + 1));
|
||||
|
@ -462,7 +466,7 @@ public class EnhancedDebugger implements SmackDebugger {
|
|||
sentText.replaceRange("", 0, sentText.getLineEndOffset(0));
|
||||
}
|
||||
catch (BadLocationException e) {
|
||||
e.printStackTrace();
|
||||
log.log(Level.SEVERE, "Error with line offset, MAX_TABLE_ROWS is set too low: " + EnhancedDebuggerWindow.MAX_TABLE_ROWS, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -895,28 +899,10 @@ public class EnhancedDebugger implements SmackDebugger {
|
|||
|
||||
}
|
||||
catch (TransformerConfigurationException tce) {
|
||||
// Error generated by the parser
|
||||
System.out.println("\n** Transformer Factory error");
|
||||
System.out.println(" " + tce.getMessage());
|
||||
|
||||
// Use the contained exception, if any
|
||||
Throwable x = tce;
|
||||
if (tce.getException() != null)
|
||||
x = tce.getException();
|
||||
x.printStackTrace();
|
||||
|
||||
log.log(Level.SEVERE, "Transformer Factory error", tce);
|
||||
}
|
||||
catch (TransformerException te) {
|
||||
// Error generated by the parser
|
||||
System.out.println("\n** Transformation error");
|
||||
System.out.println(" " + te.getMessage());
|
||||
|
||||
// Use the contained exception, if any
|
||||
Throwable x = te;
|
||||
if (te.getException() != null)
|
||||
x = te.getException();
|
||||
x.printStackTrace();
|
||||
|
||||
log.log(Level.SEVERE, "Transformation error", te);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue