Logger.Level| Constructor and Description |
|---|
SimpleLogger(int level)
Creates a new instance of SimpleLogger with the specified log level.
|
| 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
Logger.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). |
public SimpleLogger(int level)
level - The initial logging level for the logger.setLogLevel(int),
getLogLevel()public void setLogLevel(int level)
LoggersetLogLevel in interface Loggerlevel - The desired log level. Should be one of log levels defined in Log class.Logger.getLogLevel(),
Logger.isLoggable(String, int)public int getLogLevel()
LoggergetLogLevel in interface LoggerLogger.setLogLevel(int),
Logger.isLoggable(String, int)public boolean isLoggable(@NonNull String tag, int level)
LoggerisLoggable in interface LoggerTrue if the specified level is loggable, false otherwise.public void d(@NonNull String tag, @NonNull String message)
LoggerLog.d(String, String) if Log.DEBUG level is loggable at the time.public void d(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable)
LoggerLog.d(String, String, Throwable) if Log.DEBUG level is loggable
at the time.public void v(@NonNull String tag, @NonNull String message)
LoggerLog.v(String, String) if Log.VERBOSE level is loggable at the time.public void v(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable)
LoggerLog.v(String, String, Throwable) if Log.VERBOSE level is loggable
at the time.public void i(@NonNull String tag, @NonNull String message)
LoggerLog.i(String, String) if Log.INFO level is loggable at the time.public void i(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable)
LoggerLog.i(String, String, Throwable) if Log.INFO level is loggable
at the time.public void w(@NonNull String tag, @NonNull String message)
LoggerLog.w(String, String) if Log.WARN level is loggable at the time.public void w(@NonNull String tag, @Nullable Throwable throwable)
LoggerLog.w(String, Throwable) if Log.WARN level is loggable at the time.public void w(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable)
LoggerLog.w(String, String, Throwable) if Log.WARN level is loggable
at the time.public void e(@NonNull String tag, @NonNull String message)
LoggerLog.e(String, String) if Log.ERROR level is loggable at the time.public void e(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable)
LoggerLog.e(String, String, Throwable) if Log.ERROR level is loggable
at the time.public void wtf(@NonNull String tag, @NonNull String message)
LoggerLog.wtf(String, String).public void wtf(@NonNull String tag, @Nullable Throwable throwable)
LoggerLog.wtf(String, Throwable).public void wtf(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable)
LoggerLog.wtf(String, String, Throwable).public void log(int level,
@NonNull
String tag,
@NonNull
String message)
LoggerLogger.forceLog(int, String, String) if the specified level is
loggable at the time.public void forceLog(int level,
@NonNull
String tag,
@NonNull
String message)
LoggerLog.println(int, String, String) with the specified parameters.@Nullable public String getStackTraceString(@Nullable Throwable throwable)
LoggerLog.getStackTraceString(Throwable).getStackTraceString in interface Logger