org.jivesoftware.smackx.jingle
Class SmackLogger

java.lang.Object
  extended by org.jivesoftware.smackx.jingle.SmackLogger

public class SmackLogger
extends java.lang.Object

SmackLogger attempts to use Apache commons-logging if it's available. When you request an instance of SmackLogger we make an attempt to create an instance of org.apache.commons.logging.Log. If we are able to make an instance of Log then we dispatch all log requests to commons-logging. If we are not able to make an instance of Log then we dispatch all log requests to System.out/err.

Author:
jeffw

Constructor Summary
SmackLogger(java.lang.Class classToLog)
          This is private to make it impossible to instantiate a new SmackLogger outside of the getLogger() static method.
 
Method Summary
 void debug(java.lang.String inDebugMsg)
          Wrapper for commons-logging debug(Object msg)
 void debug(java.lang.String inDebugMsg, java.lang.Exception inException)
          Wrapper for commons-logging debug(Object msg)
 void error(java.lang.String inErrorMsg)
          Wrapper for commons-logging error(Object msg)
 void error(java.lang.String inErrorMsg, java.lang.Exception inException)
          Wrapper for commons-logging error(Object msg, Exception exception)
static SmackLogger getLogger(java.lang.Class classToLog)
          This static method is the only way to get an instance of a SmackLogger.
 void info(java.lang.String inDebugMsg)
          Wrapper for commons-logging info(Object msg)
 void info(java.lang.String inDebugMsg, java.lang.Exception inException)
          Wrapper for commons-logging info(Object msg)
 void warn(java.lang.String inDebugMsg)
          Wrapper for commons-logging warn(Object msg)
 void warn(java.lang.String inDebugMsg, java.lang.Exception inException)
          Wrapper for commons-logging warn(Object msg)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmackLogger

public SmackLogger(java.lang.Class classToLog)
This is private to make it impossible to instantiate a new SmackLogger outside of the getLogger() static method.

Parameters:
classToLog - This is the class that wants to log. (This gives commons-logging a means to control log-level by class.)
Method Detail

getLogger

public static SmackLogger getLogger(java.lang.Class classToLog)
This static method is the only way to get an instance of a SmackLogger.

Parameters:
classToLog - This is the class that wants to log. (This gives commons-logging a means to control log-level by class.)
Returns:
An instance of a SmackLogger for the class that wants logging.

error

public void error(java.lang.String inErrorMsg,
                  java.lang.Exception inException)
Wrapper for commons-logging error(Object msg, Exception exception)

Parameters:
inDebugMsg -

error

public void error(java.lang.String inErrorMsg)
Wrapper for commons-logging error(Object msg)

Parameters:
inDebugMsg -

debug

public void debug(java.lang.String inDebugMsg,
                  java.lang.Exception inException)
Wrapper for commons-logging debug(Object msg)

Parameters:
inDebugMsg -

debug

public void debug(java.lang.String inDebugMsg)
Wrapper for commons-logging debug(Object msg)

Parameters:
inDebugMsg -

warn

public void warn(java.lang.String inDebugMsg,
                 java.lang.Exception inException)
Wrapper for commons-logging warn(Object msg)

Parameters:
inDebugMsg -

warn

public void warn(java.lang.String inDebugMsg)
Wrapper for commons-logging warn(Object msg)

Parameters:
inDebugMsg -

info

public void info(java.lang.String inDebugMsg,
                 java.lang.Exception inException)
Wrapper for commons-logging info(Object msg)

Parameters:
inDebugMsg -

info

public void info(java.lang.String inDebugMsg)
Wrapper for commons-logging info(Object msg)

Parameters:
inDebugMsg -