debug

abstract fun debug(message: String, vararg args: Any?)

Logs a message at SentryLogLevel.DEBUG level.

Parameters

message

The message template (use %s for substitution, %% for literal %)

args

Arguments to substitute into the message template via toString()


abstract fun debug(message: String, attributes: SentryAttributes.() -> Unit)

Logs a message at SentryLogLevel.DEBUG level with inline attributes.

Example:

Sentry.logger.debug("Cache lookup for key") {
this["cache.key"] = cacheKey
this["cache.hit"] = true
}

Parameters

message

The log message

attributes

A lambda with SentryAttributes receiver to set key-value attributes


abstract fun debug(message: String, vararg args: Any?, attributes: SentryAttributes.() -> Unit)

Logs a message at SentryLogLevel.DEBUG level with template parameters and inline attributes.

Example:

Sentry.logger.debug("Cache %s for key: %s", status, cacheKey) {
this["cache.size"] = cache.size
this["cache.ttl"] = ttlSeconds
}

Parameters

message

The message template (use %s for substitution, %% for literal %)

args

Arguments to substitute into the message template via toString()

attributes

A lambda with SentryAttributes receiver to set key-value attributes


abstract fun debug(block: SentryLogBuilder.() -> Unit)

Logs a message at SentryLogLevel.DEBUG level using a DSL builder.

Example:

Sentry.logger.debug {
message("Cache %s for key: %s", if (hit) "hit" else "miss", cacheKey)
attributes {
this["cache.size"] = cache.size
this["cache.ttl"] = ttlSeconds
}
}

Parameters

block

A lambda with SentryLogBuilder receiver to configure the log entry