org.apache.commons.logging.impl
Class AndroidLog

java.lang.Object
  extended by org.apache.commons.logging.impl.AndroidLog
All Implemented Interfaces:
java.io.Serializable, Log

public class AndroidLog
extends java.lang.Object
implements Log, java.io.Serializable

Implementation of org.apache.commons.logging.Log interface which delegates all processing to android.util.Log instance.

The logging levels specified for Commons Logging can be almost directly mapped to the levels that exist in the Google Android platform. The following table shows the mapping implemented by this logger.

JCLAndroid
TRACEVERBOSE
DEBUGDEBUG
INFOINFO
WARNWARN
ERRORERROR
FATALERROR

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
 
Constructor Summary
AndroidLog()
           
AndroidLog(java.lang.String name)
           
 
Method Summary
 void debug(java.lang.Object message)
          Converts the input parameter to String and then delegates to the d method of android.util.Log.
 void debug(java.lang.Object message, java.lang.Throwable t)
          Converts the first input parameter to String and then delegates to the d method of android.util.Log.
 void error(java.lang.Object message)
          Converts the input parameter to String and then delegates to the e method of android.util.Log.
 void error(java.lang.Object message, java.lang.Throwable t)
          Converts the first input parameter to String and then delegates to the e method of android.util.Log.
 void fatal(java.lang.Object message)
          Converts the input parameter to String and then delegates to the e method of android.util.Log.
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Converts the first input parameter to String and then delegates to the e method of android.util.Log.
 void info(java.lang.Object message)
          Converts the input parameter to String and then delegates to the i method of android.util.Log.
 void info(java.lang.Object message, java.lang.Throwable t)
          Converts the first input parameter to String and then delegates to the i method of android.util.Log.
 boolean isDebugEnabled()
          Delegates to the isLoggable method of android.util.Log.
 boolean isErrorEnabled()
          Delegates to the isLoggable method of android.util.Log.
 boolean isFatalEnabled()
          Delegates to the isLoggable method of android.util.Log.
 boolean isInfoEnabled()
          Delegates to the isLoggable method of the android.util.Log.
 boolean isTraceEnabled()
          Delegates to the isLoggable method of the android.util.Log.
 boolean isWarnEnabled()
          Delegates to the isLoggable method of the android.util.Log.
 void trace(java.lang.Object message)
          Converts the input parameter to String and then delegates to the v method of android.util.Log.
 void trace(java.lang.Object message, java.lang.Throwable t)
          Converts the first input parameter to String and then delegates to the v method of android.util.Log.
 void warn(java.lang.Object message)
          Converts the input parameter to String and then delegates to the w method of android.util.Log.
 void warn(java.lang.Object message, java.lang.Throwable t)
          Converts the first input parameter to String and then delegates to the w method of android.util.Log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Constructor Detail

AndroidLog

public AndroidLog()

AndroidLog

public AndroidLog(java.lang.String name)
Method Detail

isTraceEnabled

public boolean isTraceEnabled()
Delegates to the isLoggable method of the android.util.Log.

Specified by:
isTraceEnabled in interface Log

trace

public void trace(java.lang.Object message)
Converts the input parameter to String and then delegates to the v method of android.util.Log.

Specified by:
trace in interface Log
Parameters:
message - the message to log. Converted to String

trace

public void trace(java.lang.Object message,
                  java.lang.Throwable t)
Converts the first input parameter to String and then delegates to the v method of android.util.Log.

Specified by:
trace in interface Log
Parameters:
message - the message to log. Converted to String
t - the exception to log

isDebugEnabled

public boolean isDebugEnabled()
Delegates to the isLoggable method of android.util.Log.

Specified by:
isDebugEnabled in interface Log

debug

public void debug(java.lang.Object message)
Converts the input parameter to String and then delegates to the d method of android.util.Log.

Specified by:
debug in interface Log
Parameters:
message - the message to log. Converted to String

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Converts the first input parameter to String and then delegates to the d method of android.util.Log.

Specified by:
debug in interface Log
Parameters:
message - the message to log. Converted to String
t - the exception to log

isInfoEnabled

public boolean isInfoEnabled()
Delegates to the isLoggable method of the android.util.Log.

Specified by:
isInfoEnabled in interface Log

info

public void info(java.lang.Object message)
Converts the input parameter to String and then delegates to the i method of android.util.Log.

Specified by:
info in interface Log
Parameters:
message - the message to log. Converted to String

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Converts the first input parameter to String and then delegates to the i method of android.util.Log.

Specified by:
info in interface Log
Parameters:
message - the message to log. Converted to String
t - the exception to log

isWarnEnabled

public boolean isWarnEnabled()
Delegates to the isLoggable method of the android.util.Log.

Specified by:
isWarnEnabled in interface Log

warn

public void warn(java.lang.Object message)
Converts the input parameter to String and then delegates to the w method of android.util.Log.

Specified by:
warn in interface Log
Parameters:
message - the message to log. Converted to String

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Converts the first input parameter to String and then delegates to the w method of android.util.Log.

Specified by:
warn in interface Log
Parameters:
message - the message to log. Converted to String
t - the exception to log

isErrorEnabled

public boolean isErrorEnabled()
Delegates to the isLoggable method of android.util.Log.

Specified by:
isErrorEnabled in interface Log

error

public void error(java.lang.Object message)
Converts the input parameter to String and then delegates to the e method of android.util.Log.

Specified by:
error in interface Log
Parameters:
message - the message to log. Converted to String

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Converts the first input parameter to String and then delegates to the e method of android.util.Log.

Specified by:
error in interface Log
Parameters:
message - the message to log. Converted to String
t - the exception to log

isFatalEnabled

public boolean isFatalEnabled()
Delegates to the isLoggable method of android.util.Log.

Specified by:
isFatalEnabled in interface Log

fatal

public void fatal(java.lang.Object message)
Converts the input parameter to String and then delegates to the e method of android.util.Log.

Specified by:
fatal in interface Log
Parameters:
message - the message to log. Converted to String

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Converts the first input parameter to String and then delegates to the e method of android.util.Log.

Specified by:
fatal in interface Log
Parameters:
message - the message to log. Converted to String
t - the exception to log