public final class Logger
extends java.lang.Object
Default implementation relies on Log
.
Alternative implementations can be set with setLoggerDefinition(LoggerDefinition)
.
Modifier and Type | Class and Description |
---|---|
static interface |
Logger.LogLevel
Log level indicates which logs are allowed to be emitted by the Mapbox Maps SDK for Android.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG
Priority constant for the println method; use Logger.d.
|
static int |
ERROR
Priority constant for the println method; use Logger.e.
|
static int |
INFO
Priority constant for the println method; use Logger.i.
|
static int |
NONE
Priority constant for the println method.
|
static int |
VERBOSE
Priority constant for the println method; use Logger.v
|
static int |
WARN
Priority constant for the println method; use Logger.w.
|
Constructor and Description |
---|
Logger() |
Modifier and Type | Method and Description |
---|---|
static void |
d(java.lang.String tag,
java.lang.String msg)
Send a debug log message.
|
static void |
d(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr)
Send a debug log message and log the exception.
|
static void |
e(java.lang.String tag,
java.lang.String msg)
Send an error log message.
|
static void |
e(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr)
Send an error log message and log the exception.
|
static void |
i(java.lang.String tag,
java.lang.String msg)
Send an info log message.
|
static void |
i(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr)
Send an info log message and log the exception.
|
static void |
log(int severity,
java.lang.String tag,
java.lang.String message)
Send a log message based on severity.
|
static void |
setLoggerDefinition(LoggerDefinition loggerDefinition)
Replace the current used logger definition.
|
static void |
setVerbosity(int logLevel)
Set the verbosity of the Logger.
|
static void |
v(java.lang.String tag,
java.lang.String msg)
Send a verbose log message.
|
static void |
v(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr)
Send a verbose log message and log the exception.
|
static void |
w(java.lang.String tag,
java.lang.String msg)
Send a warning log message.
|
static void |
w(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr)
Send a warning log message and log the exception.
|
public static final int VERBOSE
This log level will print all logs.
public static final int DEBUG
This log level will print all logs except verbose.
public static final int INFO
This log level will print all logs except verbose and debug.
public static final int WARN
This log level will print only warn and error logs.
public static final int ERROR
This log level will print only error logs.
public static final int NONE
This log level won't print any logs.
public static void setVerbosity(int logLevel)
This configuration can be used to have more granular control over which logs are emitted by the Mapbox Maps SDK for Android.
logLevel
- the verbosity levelpublic static void setLoggerDefinition(LoggerDefinition loggerDefinition)
loggerDefinition
- the definition of the loggerpublic static void v(java.lang.String tag, java.lang.String msg)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.public static void v(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.tr
- An exception to logpublic static void d(java.lang.String tag, java.lang.String msg)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.public static void d(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.tr
- An exception to logpublic static void i(java.lang.String tag, java.lang.String msg)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.public static void i(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.tr
- An exception to logpublic static void w(java.lang.String tag, java.lang.String msg)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.public static void w(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.tr
- An exception to logpublic static void e(java.lang.String tag, java.lang.String msg)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.public static void e(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)
tag
- Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.msg
- The message you would like logged.tr
- An exception to logpublic static void log(int severity, java.lang.String tag, java.lang.String message)
severity
- the log severitytag
- 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.