-
public final class ValidicLog
Logging facility for the Validic Mobile library. Enabling Logging is a 2 step process. Enable global logging with globalLoggingEnabled. Then, the log level must be set using ValidicLog.setLogLevel(int).
Turning off Logging can be done globally using globalLoggingEnabled, or by setting the logLevel to NONE via setLogLevel
By default, when global logging is enabled and the log level is not NONE the log will print using the android.util.Log class. ValidicLog allows for setting setting a custom Logger for more customization. See setLogger for more details
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ValidicLog.Logger
Simple logging interface for log messages
-
Method Summary
Modifier and Type Method Description static int
getLogLevel()
static void
setLogLevel(int logLevel)
Update the log level static void
setLogger(@Nullable() ValidicLog.Logger logger)
Set a custom logger implementation, set it to {@code null}
to use default logcat logging.static void
globalLoggingEnabled(boolean value)
static boolean
on()
Returns true if Logging has been enabled using globalLoggingEnabled and if the log level has been set to a LogLevel other than NONE static void
setNextTag(String tag)
static void
d(Array<byte> bytes)
static void
d(List<Array<byte>> buffer)
static void
d(String s, Array<byte> bytes, Array<Object> args)
static void
e(Throwable e)
static void
v(String message, Array<Object> args)
static void
v(Throwable t, String message, Array<Object> args)
static void
d(String message, Array<Object> args)
static void
d(Throwable t, String message, Array<Object> args)
static void
i(String message, Array<Object> args)
static void
i(Throwable t, String message, Array<Object> args)
static void
w(String message, Array<Object> args)
static void
w(Throwable t, String message, Array<Object> args)
static void
e(String message, Array<Object> args)
static void
e(Throwable t, String message, Array<Object> args)
static void
wtf(String message, Array<Object> args)
static void
wtf(Throwable t, String message, Array<Object> args)
-
-
Method Detail
-
getLogLevel
static int getLogLevel()
-
setLogLevel
static void setLogLevel(int logLevel)
Update the log level
- Parameters:
logLevel
- the log level
-
setLogger
static void setLogger(@Nullable() ValidicLog.Logger logger)
Set a custom logger implementation, set it to
{@code null}
to use default logcat logging.Example how to forward logs to Timber:
Log.setLogger(new Log.Logger() { @Override public void log(final int level, final String tag, final String msg) { Timber.tag(tag).log(level, msg); } });
-
globalLoggingEnabled
static void globalLoggingEnabled(boolean value)
-
on
static boolean on()
Returns true if Logging has been enabled using globalLoggingEnabled and if the log level has been set to a LogLevel other than NONE
-
setNextTag
static void setNextTag(String tag)
-
-
-
-