public interface Logger
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Logger.Level
Defines an annotation for available log levels.
|
| Modifier and Type | Method and Description |
|---|---|
void |
d(String tag,
String message)
Delegates to
Log.d(String, String) if Log.DEBUG level is loggable at the time. |
void |
d(String tag,
String message,
Throwable throwable)
Delegates to
Log.d(String, String, Throwable) if Log.DEBUG level is loggable
at the time. |
void |
e(String tag,
String message)
Delegates to
Log.e(String, String) if Log.ERROR level is loggable at the time. |
void |
e(String tag,
String message,
Throwable throwable)
Delegates to
Log.e(String, String, Throwable) if Log.ERROR level is loggable
at the time. |
void |
forceLog(int level,
String tag,
String message)
Delegates to
Log.println(int, String, String) with the specified parameters. |
int |
getLogLevel()
Returns the logging level specified for this logger.
|
String |
getStackTraceString(Throwable throwable)
Delegates to
Log.getStackTraceString(Throwable). |
void |
i(String tag,
String message)
Delegates to
Log.i(String, String) if Log.INFO level is loggable at the time. |
void |
i(String tag,
String message,
Throwable throwable)
Delegates to
Log.i(String, String, Throwable) if Log.INFO level is loggable
at the time. |
boolean |
isLoggable(String tag,
int level)
Checks whether a log output for the specified level may be logged or not.
|
void |
log(int level,
String tag,
String message)
Delegates to
forceLog(int, String, String) if the specified level is
loggable at the time. |
void |
setLogLevel(int level)
Sets a logging level for this logger.
|
void |
v(String tag,
String message)
Delegates to
Log.v(String, String) if Log.VERBOSE level is loggable at the time. |
void |
v(String tag,
String message,
Throwable throwable)
Delegates to
Log.v(String, String, Throwable) if Log.VERBOSE level is loggable
at the time. |
void |
w(String tag,
String message)
Delegates to
Log.w(String, String) if Log.WARN level is loggable at the time. |
void |
w(String tag,
String message,
Throwable throwable)
Delegates to
Log.w(String, String, Throwable) if Log.WARN level is loggable
at the time. |
void |
w(String tag,
Throwable throwable)
Delegates to
Log.w(String, Throwable) if Log.WARN level is loggable at the time. |
void |
wtf(String tag,
String message)
Delegates to
Log.wtf(String, String). |
void |
wtf(String tag,
String message,
Throwable throwable)
Delegates to
Log.wtf(String, String, Throwable). |
void |
wtf(String tag,
Throwable throwable)
Delegates to
Log.wtf(String, Throwable). |
void setLogLevel(int level)
level - The desired log level. Should be one of log levels defined in Log class.getLogLevel(),
isLoggable(String, int)int getLogLevel()
setLogLevel(int),
isLoggable(String, int)boolean isLoggable(@NonNull
String tag,
int level)
True if the specified level is loggable, false otherwise.void d(@NonNull
String tag,
@NonNull
String message)
Log.d(String, String) if Log.DEBUG level is loggable at the time.void d(@NonNull
String tag,
@NonNull
String message,
@Nullable
Throwable throwable)
Log.d(String, String, Throwable) if Log.DEBUG level is loggable
at the time.void v(@NonNull
String tag,
@NonNull
String message)
Log.v(String, String) if Log.VERBOSE level is loggable at the time.void v(@NonNull
String tag,
@NonNull
String message,
@Nullable
Throwable throwable)
Log.v(String, String, Throwable) if Log.VERBOSE level is loggable
at the time.void i(@NonNull
String tag,
@NonNull
String message)
Log.i(String, String) if Log.INFO level is loggable at the time.void i(@NonNull
String tag,
@NonNull
String message,
@Nullable
Throwable throwable)
Log.i(String, String, Throwable) if Log.INFO level is loggable
at the time.void w(@NonNull
String tag,
@NonNull
String message)
Log.w(String, String) if Log.WARN level is loggable at the time.void w(@NonNull
String tag,
@Nullable
Throwable throwable)
Log.w(String, Throwable) if Log.WARN level is loggable at the time.void w(@NonNull
String tag,
@NonNull
String message,
@Nullable
Throwable throwable)
Log.w(String, String, Throwable) if Log.WARN level is loggable
at the time.void e(@NonNull
String tag,
@NonNull
String message)
Log.e(String, String) if Log.ERROR level is loggable at the time.void e(@NonNull
String tag,
@NonNull
String message,
@Nullable
Throwable throwable)
Log.e(String, String, Throwable) if Log.ERROR level is loggable
at the time.void wtf(@NonNull
String tag,
@Nullable
Throwable throwable)
Log.wtf(String, Throwable).void wtf(@NonNull
String tag,
@NonNull
String message,
@Nullable
Throwable throwable)
Log.wtf(String, String, Throwable).void log(int level,
@NonNull
String tag,
@NonNull
String message)
forceLog(int, String, String) if the specified level is
loggable at the time.void forceLog(int level,
@NonNull
String tag,
@NonNull
String message)
Log.println(int, String, String) with the specified parameters.