public class BrazeLogger
extends java.lang.Object
Log
so that Braze log messages can be set to a configurable level.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LOG_LEVEL |
static int |
SUPPRESS |
Constructor and Description |
---|
BrazeLogger() |
Modifier and Type | Method and Description |
---|---|
static void |
checkForSystemLogLevelProperty()
Internal Braze method.
|
static int |
d(java.lang.String tag,
java.lang.String msg) |
static int |
d(java.lang.String tag,
java.lang.String msg,
boolean includeInTestUserLog)
Logs made with this method do not call the
TestUserDeviceLoggingManager with the log contents. |
static int |
d(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr) |
static int |
d(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr,
boolean includeInTestUserLog)
Logs made with this method do not call the
TestUserDeviceLoggingManager with the log contents. |
static int |
e(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr) |
static java.lang.String |
getAppboyLogTag(java.lang.Class<?> classForTag)
Deprecated.
|
static java.lang.String |
getBrazeLogTag(java.lang.Class<?> classForTag)
Returns a
Log tag string prepended with the Braze SDK version and appended with
Class.getName() . |
static int |
getLogLevel()
Gets the log level used for logging messages from the Braze SDK.
|
static int |
i(java.lang.String tag,
java.lang.String msg) |
static int |
i(java.lang.String tag,
java.lang.String msg,
boolean includeInTestUserLog)
Logs made with this method do not call the
TestUserDeviceLoggingManager with the log contents. |
static int |
i(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr) |
static int |
i(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr,
boolean includeInTestUserLog)
Logs made with this method do not call the
TestUserDeviceLoggingManager with the log contents. |
static void |
setInitialLogLevelFromConfiguration(int logLevel)
Sets the log level if no log level was ever set via
setLogLevel(int) . |
static void |
setLogLevel(int logLevel)
Sets the log level used for logging messages from the Braze SDK.
|
static void |
setTestUserDeviceLoggingManager(TestUserDeviceLoggingManager testUserDeviceLoggingManager)
Internal Appboy method.
|
static int |
v(java.lang.String tag,
java.lang.String msg)
Send a verbose log message.
|
static int |
v(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr) |
static int |
w(java.lang.String tag,
java.lang.String msg) |
static int |
w(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable tr) |
static int |
w(java.lang.String tag,
java.lang.Throwable tr) |
public static final int SUPPRESS
public static final int DEFAULT_LOG_LEVEL
public static void checkForSystemLogLevelProperty()
public static void setInitialLogLevelFromConfiguration(int logLevel)
setLogLevel(int)
. The
purpose of this method is allow for the safe setting of an initial configuration
value while not overriding any log level calls made in code before the SDK was
initialized.public static void setLogLevel(int logLevel)
Log
method.
Log messages below the set log level will be dropped.
It is strongly recommended that the log level be lowered in debug/development environments as full logging
in live apps is very valuable for debugging.
When the log level has been set via a system property, this method does nothing.logLevel
- the log level. Set to one of the Log
priority constants or
SUPPRESS
to hide all log output.public static int getLogLevel()
setLogLevel(int)
public static int 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 int 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 int 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 int 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 int d(java.lang.String tag, java.lang.String msg, boolean includeInTestUserLog)
TestUserDeviceLoggingManager
with the log contents.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.includeInTestUserLog
- When true, includes this log in the test user log.public static int d(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr, boolean includeInTestUserLog)
TestUserDeviceLoggingManager
with the log contents.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 logincludeInTestUserLog
- When true, includes this log in the test user log.public static int 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 int 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 int i(java.lang.String tag, java.lang.String msg, boolean includeInTestUserLog)
TestUserDeviceLoggingManager
with the log contents.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.includeInTestUserLog
- When true, includes this log in the test user log.public static int i(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr, boolean includeInTestUserLog)
TestUserDeviceLoggingManager
with the log contents.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 logincludeInTestUserLog
- When true, includes this log in the test user log.public static int 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 int 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 int w(java.lang.String tag, 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.tr
- An exception to logpublic static int 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 log@Deprecated public static java.lang.String getAppboyLogTag(java.lang.Class<?> classForTag)
public static java.lang.String getBrazeLogTag(java.lang.Class<?> classForTag)
Log
tag string prepended with the Braze SDK version and appended with
Class.getName()
. The class name will be shortened to a logcat appropriate length.public static void setTestUserDeviceLoggingManager(TestUserDeviceLoggingManager testUserDeviceLoggingManager)