mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-25 13:57:58 +01:00
Rename SmackConfiguration.DEBUG_ENABLED to DEBUG
This commit is contained in:
parent
672d131280
commit
440af7675a
12 changed files with 25 additions and 25 deletions
|
@ -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:
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue