public class AndroidLogger extends Object implements Log, Serializable
Implementation of org.apache.commons.logging.Log interface which delegates all processing to android.util.Log instance.
The logging levels specified for Java Commons Logging can be directly mapped to the levels that exist in the Google Android platform.
There is an exception, Android API has no FATAL level. So, the JCL FATAL level maps to the ERROR Android level
The following table shows the mapping from JCL log levels to log levels in the Android platform, implemented by this logger:
| JCL Level | Android Level |
|---|---|
| TRACE | VERBOSE |
| DEBUG | DEBUG |
| INFO | INFO |
| WARN | WARN |
| ERROR | ERROR |
| FATAL | ERROR |
| Constructor and Description |
|---|
AndroidLogger() |
AndroidLogger(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(Object message)
Converts the input parameter to String and then delegates to the
d method of android.util.Log. |
void |
debug(Object message,
Throwable t)
Converts the first input parameter to String and then delegates to the
d method of android.util.Log. |
void |
error(Object message)
Converts the input parameter to String and then delegates to the
e method of android.util.Log. |
void |
error(Object message,
Throwable t)
Converts the first input parameter to String and then delegates to the
e method of android.util.Log. |
void |
fatal(Object message)
Converts the input parameter to String and then delegates to the
e method of android.util.Log. |
void |
fatal(Object message,
Throwable t)
Converts the first input parameter to String and then delegates to the
e method of android.util.Log. |
void |
info(Object message)
Converts the input parameter to String and then delegates to the
i method of android.util.Log. |
void |
info(Object message,
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 |
boolean |
isErrorEnabled()
Delegates to the
isLoggable |
boolean |
isFatalEnabled()
Delegates to the
isLoggable |
boolean |
isInfoEnabled()
Delegates to the
isLoggable |
boolean |
isTraceEnabled()
Delegates to the
isLoggable |
boolean |
isWarnEnabled()
Delegates to the
isLoggable |
void |
trace(Object message)
Converts the input parameter to String and then delegates to the
v method of android.util.Log. |
void |
trace(Object message,
Throwable t)
Converts the first input parameter to String and then delegates to the
v method of android.util.Log. |
void |
warn(Object message)
Converts the input parameter to String and then delegates to the
w method of android.util.Log. |
void |
warn(Object message,
Throwable t)
Converts the first input parameter to String and then delegates to the
w method of android.util.Log. |
protected String name
public AndroidLogger()
public AndroidLogger(String name)
public boolean isTraceEnabled()
isLoggable method of the
android.util.Log.isTraceEnabled in interface Logpublic void trace(Object message)
v method of android.util.Log.public void trace(Object message, Throwable t)
v method of android.util.Log.public boolean isDebugEnabled()
isLoggable method of
android.util.Log.isDebugEnabled in interface Logpublic void debug(Object message)
d method of android.util.Log.public void debug(Object message, Throwable t)
d method of android.util.Log.public boolean isInfoEnabled()
isLoggable method of the
android.util.Log.isInfoEnabled in interface Logpublic void info(Object message)
i method of android.util.Log.public void info(Object message, Throwable t)
i method of android.util.Log.public boolean isWarnEnabled()
isLoggable method of the
android.util.Log.isWarnEnabled in interface Logpublic void warn(Object message)
w method of android.util.Log.public void warn(Object message, Throwable t)
w method of android.util.Log.public boolean isErrorEnabled()
isLoggable method of
android.util.Log.isErrorEnabled in interface Logpublic void error(Object message)
e method of android.util.Log.public void error(Object message, Throwable t)
e method of android.util.Log.public boolean isFatalEnabled()
isLoggable method of
android.util.Log.isFatalEnabled in interface Logpublic void fatal(Object message)
e method of android.util.Log.Copyright © 2014. All rights reserved.