1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 13:32:07 +01:00

Rename SmackConfiguration.DEBUG_ENABLED to DEBUG

This commit is contained in:
Florian Schmaus 2015-01-18 21:33:03 +01:00
parent 672d131280
commit 440af7675a
12 changed files with 25 additions and 25 deletions

View file

@ -11,7 +11,7 @@ Debugging mode can be enabled in two different ways:
1. Add the following line of code **before** creating new connections:
`XMPPConnection.DEBUG_ENABLED = true;`
`SmackConfiguration.DEBUG = true;`
2. Set the Java system property `smack.debugEnabled` to true. The system property can be set on the command line such as:
@ -21,7 +21,7 @@ If you wish to explicitly disable debug mode in your application, including
using the command-line parameter, add the following line to your application
before opening new connections:
`XMPPConnection.DEBUG_ENABLED = false;`
`SmackConfiguration.DEBUG = false;`
Smack uses the following logic to decide the debugger console to use:

View file

@ -515,7 +515,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
// If debugging is enabled, change the the debug window title to include the
// name we are now logged-in as.
// If DEBUG_ENABLED was set to true AFTER the connection was created the debugger
// If DEBUG was set to true AFTER the connection was created the debugger
// will be null
if (config.isDebuggerEnabled() && debugger != null) {
debugger.userHasLogged(user);

View file

@ -35,7 +35,7 @@ public abstract class ConnectionConfiguration {
static {
// Ensure that Smack is initialized when ConnectionConfiguration is used, or otherwise e.g.
// SmackConfiguration.DEBUG_ENABLED may not be initialized yet.
// SmackConfiguration.DEBUG may not be initialized yet.
SmackConfiguration.getVersion();
}
@ -226,7 +226,7 @@ public abstract class ConnectionConfiguration {
/**
* Returns true if the new connection about to be establish is going to be debugged. By
* default the value of {@link SmackConfiguration#DEBUG_ENABLED} is used.
* default the value of {@link SmackConfiguration#DEBUG} is used.
*
* @return true if the new connection about to be establish is going to be debugged.
*/
@ -399,7 +399,7 @@ public abstract class ConnectionConfiguration {
private RosterStore rosterStore;
private ProxyInfo proxy;
private CallbackHandler callbackHandler;
private boolean debuggerEnabled = SmackConfiguration.DEBUG_ENABLED;
private boolean debuggerEnabled = SmackConfiguration.DEBUG;
private SocketFactory socketFactory;
private String serviceName;
private String host;
@ -634,7 +634,7 @@ public abstract class ConnectionConfiguration {
/**
* Sets if the new connection about to be establish is going to be debugged. By
* default the value of {@link SmackConfiguration#DEBUG_ENABLED} is used.
* default the value of {@link SmackConfiguration#DEBUG} is used.
*
* @param debuggerEnabled if the new connection about to be establish is going to be debugged.
* @return a reference to this builder.

View file

@ -77,7 +77,7 @@ public final class SmackConfiguration {
* property <tt>smack.debugEnabled</tt> to true. The system property can be set on the
* command line such as "java SomeApp -Dsmack.debugEnabled=true".
*/
public static boolean DEBUG_ENABLED = false;
public static boolean DEBUG = false;
/**
* The default parsing exception callback is {@link ExceptionThrowingCallback} which will

View file

@ -55,7 +55,7 @@ public final class SmackInitialization {
* So far this means that:
* 1) a set of classes will be loaded in order to execute their static init block
* 2) retrieve and set the current Smack release
* 3) set DEBUG_ENABLED
* 3) set DEBUG
*/
static {
String smackVersion;
@ -127,10 +127,10 @@ public final class SmackInitialization {
// Use try block since we may not have permission to get a system
// property (for example, when an applet).
try {
// Only overwrite DEBUG_ENABLED if it is set via the 'smack.debugEnabled' property. To prevent DEBUG_ENABLED
// Only overwrite DEBUG if it is set via the 'smack.debugEnabled' property. To prevent DEBUG_ENABLED
// = true, which could be set e.g. via a static block from user code, from being overwritten by the property not set
if (Boolean.getBoolean("smack.debugEnabled")) {
SmackConfiguration.DEBUG_ENABLED = true;
SmackConfiguration.DEBUG = true;
}
}
catch (Exception e) {

View file

@ -153,7 +153,7 @@ public class DummyConnection extends AbstractXMPPConnection {
@Override
public void send(PlainStreamElement element) {
if (SmackConfiguration.DEBUG_ENABLED) {
if (SmackConfiguration.DEBUG) {
System.out.println("[SEND]: " + element.toXML());
}
queue.add(element);
@ -161,7 +161,7 @@ public class DummyConnection extends AbstractXMPPConnection {
@Override
protected void sendPacketInternal(Packet packet) {
if (SmackConfiguration.DEBUG_ENABLED) {
if (SmackConfiguration.DEBUG) {
System.out.println("[SEND]: " + packet.toXML());
}
queue.add(packet);
@ -213,7 +213,7 @@ public class DummyConnection extends AbstractXMPPConnection {
* @param packet the packet to process.
*/
public void processPacket(Packet packet) {
if (SmackConfiguration.DEBUG_ENABLED) {
if (SmackConfiguration.DEBUG) {
System.out.println("[RECV]: " + packet.toXML());
}

View file

@ -63,7 +63,7 @@ public class RosterTest {
@Before
public void setUp() throws Exception {
// Uncomment this to enable debug output
//XMPPConnection.DEBUG_ENABLED = true;
//SmackConfiguration.DEBUG = true;
connection = new DummyConnection();
connection.connect();
@ -708,7 +708,7 @@ public class RosterTest {
public synchronized void entriesAdded(Collection<String> addresses) {
addressesAdded.addAll(addresses);
if (SmackConfiguration.DEBUG_ENABLED) {
if (SmackConfiguration.DEBUG) {
for (String address : addresses) {
System.out.println("Roster entry for " + address + " added.");
}
@ -718,7 +718,7 @@ public class RosterTest {
public synchronized void entriesDeleted(Collection<String> addresses) {
addressesDeleted.addAll(addresses);
if (SmackConfiguration.DEBUG_ENABLED) {
if (SmackConfiguration.DEBUG) {
for (String address : addresses) {
System.out.println("Roster entry for " + address + " deleted.");
}
@ -728,7 +728,7 @@ public class RosterTest {
public synchronized void entriesUpdated(Collection<String> addresses) {
addressesUpdated.addAll(addresses);
if (SmackConfiguration.DEBUG_ENABLED) {
if (SmackConfiguration.DEBUG) {
for (String address : addresses) {
System.out.println("Roster entry for " + address + " updated.");
}
@ -737,7 +737,7 @@ public class RosterTest {
}
public void presenceChanged(Presence presence) {
if (SmackConfiguration.DEBUG_ENABLED) {
if (SmackConfiguration.DEBUG) {
System.out.println("Roster presence changed: " + presence.toXML());
}
reportInvoked();

View file

@ -1797,7 +1797,7 @@ public class MultiUserChatTest extends SmackTestCase {
}
protected void setUp() throws Exception {
//TCPConnection.DEBUG_ENABLED = false;
//SmackConfiguration.DEBUG = false;
super.setUp();
room = "fruta124@" + getMUCDomain();
try {

View file

@ -32,7 +32,7 @@ public class FileTransferNegotiatorTest {
@Before
public void setUp() throws Exception {
// Uncomment this to enable debug output
// XMPPConnection.DEBUG_ENABLED = true;
// SmackConfiguration.DEBUG = true;
connection = new DummyConnection();
connection.connect();

View file

@ -43,7 +43,7 @@ public class ItemValidationTest extends InitExtensions {
public void setUp() throws Exception
{
// Uncomment this to enable debug output
// XMPPConnection.DEBUG_ENABLED = true;
// SmackConfiguration.DEBUG = true;
connection = new ThreadedDummyConnection();
connection.connect();

View file

@ -685,7 +685,7 @@ public class JingleManagerTest extends SmackTestCase {
XMPPTCPConnection x0 = getConnection(0);
XMPPTCPConnection x1 = getConnection(1);
XMPPTCPConnection.DEBUG_ENABLED = true;
XMPPSmackConfiguration.DEBUG = true;
FixedResolver tr0 = new FixedResolver("127.0.0.1", 20080);
FixedTransportManager ftm0 = new FixedTransportManager(tr0);

View file

@ -212,7 +212,7 @@ public class JingleMediaTest extends SmackTestCase {
try {
//TCPConnection.DEBUG_ENABLED = true;
//SmackConfiguration.DEBUG = true;
XMPPTCPConnection x0 = getConnection(0);
XMPPTCPConnection x1 = getConnection(1);
@ -399,7 +399,7 @@ public class JingleMediaTest extends SmackTestCase {
public void testCompleteWithBridgeB() {
try {
//TCPConnection.DEBUG_ENABLED = true;
//SmackConfiguration.DEBUG = true;
XMPPTCPConnection x0 = getConnection(0);
XMPPTCPConnection x1 = getConnection(1);