BrazeLogger

Wraps Log so that Braze log messages can be set to a configurable level.

Types

Link copied to clipboard

Functions

Link copied to clipboard
fun Any.brazelog(priority: BrazeLogger.Priority = D, tr: Throwable? = null, message: () -> String)

Sends a log message from a class.

fun brazelog(tag: String, priority: BrazeLogger.Priority = D, tr: Throwable? = null, message: () -> String)

Sends a log message outside of a class (or to specify a tag explicitly). Tag should also be specified when using within a coroutine.

Link copied to clipboard

Generates a tag for a class.

Link copied to clipboard

Internal Braze method. Do not use.

Link copied to clipboard
fun d(tag: String, msg: String, tr: Throwable? = null)

Sends a debug log message.

Link copied to clipboard
fun e(tag: String, msg: String, tr: Throwable)

Sends an error level log message.

Link copied to clipboard

Gets the Braze log tag from a String.

fun getBrazeLogTag(classForTag: Class<*>): String

Returns a 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.

Link copied to clipboard
fun i(tag: String, msg: String, tr: Throwable? = null)

Sends an info level log message.

Link copied to clipboard
Link copied to clipboard

Sets the log level if no log level was ever set via BrazeLogger.logLevel. 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.

Link copied to clipboard
fun v(tag: String, msg: String, tr: Throwable? = null)

Sends a verbose log message.

Link copied to clipboard
fun w(tag: String, msg: String, tr: Throwable? = null)

Sends an warn level log message.

Properties

Link copied to clipboard

Sets the log level used for logging messages from the Braze SDK.

Link copied to clipboard
var onLoggedCallback: (priority: BrazeLogger.Priority, message: String, throwable: Throwable?) -> Unit? = null

A callback function fired whenever a log is made from this class. Does not perform any filtering based on logLevel.

Link copied to clipboard
const val SUPPRESS: Int
Link copied to clipboard
const val VERBOSE: Int