Modifier and Type | Field and Description |
---|---|
protected boolean |
mEnabled |
protected String |
mTag |
Constructor and Description |
---|
JobCat(Class<?> clazz) |
JobCat(String tag) |
JobCat(String tag,
boolean enabled) |
Modifier and Type | Method and Description |
---|---|
static boolean |
addLogger(JobLogger logger)
Add a global logger for the job library, which will be notified about each log statement.
|
static void |
clearLogger() |
void |
d(String message) |
void |
d(String message,
Object... args) |
void |
d(Throwable t,
String message,
Object... args) |
void |
e(String message) |
void |
e(String message,
Object... args) |
void |
e(Throwable t) |
void |
e(Throwable t,
String message,
Object... args) |
void |
i(String message) |
void |
i(String message,
Object... args) |
static boolean |
isLogcatEnabled() |
void |
log(int priority,
String tag,
String message,
Throwable t)
Log a message from the library.
|
static void |
removeLogger(JobLogger logger)
Remove a global logger.
|
static void |
setLogcatEnabled(boolean enabled)
Global switch to enable or disable printing log messages to Logcat.
|
void |
w(String message) |
void |
w(String message,
Object... args) |
void |
w(Throwable t,
String message,
Object... args) |
protected final String mTag
protected final boolean mEnabled
public JobCat(Class<?> clazz)
public JobCat(String tag)
public JobCat(String tag, boolean enabled)
public static boolean addLogger(@NonNull JobLogger logger)
logger
- Your desired logger.true
if the logger was added. Returns false
if the logger was
already added.public static void removeLogger(@NonNull JobLogger logger)
logger
- Your desired logger.addLogger(JobLogger)
public static void clearLogger()
public static void setLogcatEnabled(boolean enabled)
enabled
- Whether or not to print all log messages. The default value is true
.public static boolean isLogcatEnabled()
true
.