public class DefaultLogDelagate extends java.lang.Object implements LogDelegate
DefaultLogDelagate
provides a default implemenation of LogDelegate
that utilises
Log
for implementation.Constructor and Description |
---|
DefaultLogDelagate() |
Modifier and Type | Method and Description |
---|---|
int |
d(java.lang.String tag,
java.lang.String message)
Send a
#DEBUG log message. |
int |
d(java.lang.String tag,
java.lang.String message,
java.lang.Throwable throwable)
Send a
#DEBUG log message and log the exception. |
int |
e(java.lang.String tag,
java.lang.String message)
Send an
#ERROR log message. |
int |
e(java.lang.String tag,
java.lang.String message,
java.lang.Throwable throwable)
Send a
#ERROR log message and log the exception. |
java.lang.String |
getStackTraceString(java.lang.Throwable throwable)
Handy function to get a loggable stack trace from a
Throwable |
int |
i(java.lang.String tag,
java.lang.String message)
Send an
#INFO log message. |
int |
i(java.lang.String tag,
java.lang.String message,
java.lang.Throwable throwable)
Send a
#INFO log message and log the exception. |
boolean |
isLoggable(java.lang.String tag,
int level)
Checks to see whether or not a log for the specified tag is loggable at the specified level.
|
int |
println(int priority,
java.lang.String tag,
java.lang.String message)
Low-level logging call.
|
int |
v(java.lang.String tag,
java.lang.String message)
Send a
#VERBOSE log message. |
int |
v(java.lang.String tag,
java.lang.String message,
java.lang.Throwable throwable)
Send a
#VERBOSE log message and log the exception. |
int |
w(java.lang.String tag,
java.lang.String message)
Send a
#WARN log message. |
int |
w(java.lang.String tag,
java.lang.String message,
java.lang.Throwable throwable)
Send a
#WARN log message and log the exception. |
int |
w(java.lang.String tag,
java.lang.Throwable throwable) |
int |
wtf(java.lang.String tag,
java.lang.String message)
What a Terrible Failure: Report a condition that should never happen.
|
int |
wtf(java.lang.String tag,
java.lang.String message,
java.lang.Throwable throwable)
What a Terrible Failure: Report an exception that should never happen.
|
int |
wtf(java.lang.String tag,
java.lang.Throwable throwable)
What a Terrible Failure: Report an exception that should never happen.
|
public int v(java.lang.String tag, java.lang.String message)
LogDelegate
#VERBOSE
log message.v
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.public int v(java.lang.String tag, java.lang.String message, java.lang.Throwable throwable)
LogDelegate
#VERBOSE
log message and log the exception.v
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.throwable
- An exception to logpublic int d(java.lang.String tag, java.lang.String message)
LogDelegate
#DEBUG
log message.d
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.public int d(java.lang.String tag, java.lang.String message, java.lang.Throwable throwable)
LogDelegate
#DEBUG
log message and log the exception.d
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.throwable
- An exception to logpublic int i(java.lang.String tag, java.lang.String message)
LogDelegate
#INFO
log message.i
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.public int i(java.lang.String tag, java.lang.String message, java.lang.Throwable throwable)
LogDelegate
#INFO
log message and log the exception.i
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.throwable
- An exception to logpublic int w(java.lang.String tag, java.lang.String message)
LogDelegate
#WARN
log message.w
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.public int w(java.lang.String tag, java.lang.String message, java.lang.Throwable throwable)
LogDelegate
#WARN
log message and log the exception.w
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.throwable
- An exception to logpublic boolean isLoggable(java.lang.String tag, int level)
LogDelegate
isLoggable
in interface LogDelegate
tag
- The tag to check.level
- The level to check.public int w(java.lang.String tag, java.lang.Throwable throwable)
w
in interface LogDelegate
public int e(java.lang.String tag, java.lang.String message)
LogDelegate
#ERROR
log message.e
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.public int e(java.lang.String tag, java.lang.String message, java.lang.Throwable throwable)
LogDelegate
#ERROR
log message and log the exception.e
in interface LogDelegate
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.throwable
- An exception to logpublic int wtf(java.lang.String tag, java.lang.String message)
LogDelegate
wtf
in interface LogDelegate
tag
- Used to identify the source of a log message.message
- The message you would like logged.public int wtf(java.lang.String tag, java.lang.Throwable throwable)
LogDelegate
LogDelegate.wtf(String, String)
, with an exception to log.wtf
in interface LogDelegate
tag
- Used to identify the source of a log message.throwable
- An exception to log.public int wtf(java.lang.String tag, java.lang.String message, java.lang.Throwable throwable)
LogDelegate
LogDelegate.wtf(String, Throwable)
, with a message as well.wtf
in interface LogDelegate
tag
- Used to identify the source of a log message.message
- The message you would like logged.throwable
- A Throwable
to log. May be null
.public java.lang.String getStackTraceString(java.lang.Throwable throwable)
LogDelegate
Throwable
getStackTraceString
in interface LogDelegate
throwable
- An exception to logpublic int println(int priority, java.lang.String tag, java.lang.String message)
LogDelegate
println
in interface LogDelegate
priority
- The priority/type of this log messagetag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.message
- The message you would like logged.