src/main/java/org/jivesoftware/smack/Connection.java
protected void initDebugger() {
        if (reader == null || writer == null) {
            throw new NullPointerException(
                    "Reader or writer isn't initialized.");
        }
        // If debugging is enabled, we open a window and write out all network
        // traffic.
        if (config.isDebuggerEnabled()) {
            if (debugger == null) {
                // Detect the debugger class to use.
                String className = null;
                // Use try block since we may not have permission to get a
                // system
                // property (for example, when an applet).
                try {
                    className = System.getProperty("smack.debuggerClass");
                } catch (Throwable t) {
                    // Ignore.
                }
                Class<?> debuggerClass = null;
                if (className != null) {
                    try {
                        debuggerClass = Class.forName(className);
                    } catch (Exception e) {
                        log.warn("Unabled to instantiate debugger class "
                                + className);
                    }
                }
                if (debuggerClass == null) {
                    try {
                        debuggerClass = Class
                                .forName("org.jivesoftware.smackx.debugger.EnhancedDebugger");
                    } catch (Exception ex) {
                        try {
                            debuggerClass = Class
                                    .forName("org.jivesoftware.smack.debugger.LiteDebugger");
                        } catch (Exception ex2) {
                            log.warn("Unabled to instantiate either Smack debugger class");
                        }
                    }
                }
                // Create a new debugger instance. If an exception occurs then
                // disable the debugging
                // option
                try {
                    Constructor<?> constructor = debuggerClass.getConstructor(
                            Connection.class, Writer.class, Reader.class);
                    debugger = (SmackDebugger) constructor.newInstance(this,
                            writer, reader);
                    reader = debugger.getReader();
                    writer = debugger.getWriter();
                } catch (Exception e) {
                    throw new IllegalArgumentException(
                            "Can't initialize the configured debugger!", e);
                }
            } else {
                // Obtain new reader and writer from the existing debugger
                reader = debugger.newConnectionReader(reader);
                writer = debugger.newConnectionWriter(writer);
            }
        }
    }
protected void initDebugger() {
        if (reader == null || writer == null) {
            throw new NullPointerException(
                    "Reader or writer isn't initialized.");
        }
        // If debugging is enabled, we open a window and write out all network
        // traffic.
        if (config.isDebuggerEnabled()) {
            if (debugger == null) {
                // Detect the debugger class to use.
                String className = null;
                // Use try block since we may not have permission to get a
                // system
                // property (for example, when an applet).
                try {
                    className = System.getProperty("smack.debuggerClass");
                } catch (Throwable t) {
                    // Ignore.
                }
                Class<?> debuggerClass = null;
                if (className != null) {
                    try {
                        debuggerClass = Class.forName(className);
                    } catch (Exception e) {
                        log.warn("Unabled to instantiate debugger class "
                                + className);
                    }
                }
                if (debuggerClass == null) {
                    try {
                        debuggerClass = Class
                                .forName("org.jivesoftware.smackx.debugger.EnhancedDebugger");
                    } catch (Exception ex) {
                        try {
                            debuggerClass = Class
                                    .forName("org.jivesoftware.smack.debugger.LiteDebugger");
                        } catch (Exception ex2) {
                            log.warn("Unabled to instantiate either Smack debugger class");
                        }
                    }
                }
                // Create a new debugger instance. If an exception occurs then
                // disable the debugging
                // option
                try {
                    Constructor<?> constructor = debuggerClass.getConstructor(
                            Connection.class, Writer.class, Reader.class);
                    debugger = (SmackDebugger) constructor.newInstance(this,
                            writer, reader);
                    reader = debugger.getReader();
                    writer = debugger.getWriter();
                } catch (Exception e) {
                    throw new IllegalArgumentException(
                            "Can't initialize the configured debugger!", e);
                }
            } else {
                // Obtain new reader and writer from the existing debugger
                reader = debugger.newConnectionReader(reader);
                writer = debugger.newConnectionWriter(writer);
            }
        }
    }
protected void initDebugger ( ) { if ( reader == null || writer == null ) { throw new NullPointerException ( "Reader or writer isn't initialized." ) ; } // If debugging is enabled, we open a window and write out all network // traffic. if ( config . isDebuggerEnabled ( ) ) { if ( debugger == null ) { // Detect the debugger class to use. String className = null ; // Use try block since we may not have permission to get a // system // property (for example, when an applet). try { className = System . getProperty ( "smack.debuggerClass" ) ; } catch ( Throwable t ) { // Ignore. } Class < ? > debuggerClass = null ; if ( className != null ) { try { debuggerClass = Class . forName ( className ) ; } catch ( Exception e ) { log . warn ( "Unabled to instantiate debugger class " + className ) ; } } if ( debuggerClass == null ) { try { debuggerClass = Class . forName ( "org.jivesoftware.smackx.debugger.EnhancedDebugger" ) ; } catch ( Exception ex ) { try { debuggerClass = Class . forName ( "org.jivesoftware.smack.debugger.LiteDebugger" ) ; } catch ( Exception ex2 ) { log . warn ( "Unabled to instantiate either Smack debugger class" ) ; } } } // Create a new debugger instance. If an exception occurs then // disable the debugging // option try { Constructor < ? > constructor = debuggerClass . getConstructor ( Connection . class , Writer . class , Reader . class ) ; debugger = ( SmackDebugger ) constructor . newInstance ( this , writer , reader ) ; reader = debugger . getReader ( ) ; writer = debugger . getWriter ( ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Can't initialize the configured debugger!" , e ) ; } } else { // Obtain new reader and writer from the existing debugger reader = debugger . newConnectionReader ( reader ) ; writer = debugger . newConnectionWriter ( writer ) ; } } }
Initialize the {@link #debugger}. You can specify a customized
{@link SmackDebugger} by setup the system property
<code>smack.debuggerClass</code> to the implementation.

@throws IllegalStateException
if the reader or writer isn't yet initialized.
@throws IllegalArgumentException
if the SmackDebugger can't be loaded.
Initialize the { @link #debugger } . You can specify a customized { @link SmackDebugger } by setup the system property <code > smack . debuggerClass< / code > to the implementation .