Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Improvements

- Skip building Android manifest metadata debug log messages when debug logging is disabled, reducing allocations during SDK init ([#5790](https://github.com/getsentry/sentry-java/pull/5790))

### Fixes

- Backfill release, environment, distribution, tags, and app version/build—and use the matching replay-on-error sample rate—for `ApplicationExitInfo` ANR and native crash events captured before SDK initialization, without reusing options cached by a later app update ([#5762](https://github.com/getsentry/sentry-java/pull/5762))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,9 @@ private static boolean readBool(
final @NotNull String key,
final boolean defaultValue) {
final boolean value = metadata.getBoolean(key, defaultValue);
logger.log(SentryLevel.DEBUG, key + " read: " + value);
if (logger.isEnabled(SentryLevel.DEBUG)) {

@runningcode runningcode Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could provide a new api to build the strings inside a lambda like Timber does. I wonder if customers have asked for this.

logger.log(SentryLevel.DEBUG, key + " read: " + value);
}
return value;
}

Expand All @@ -789,7 +791,9 @@ private static boolean readBool(
final @NotNull String key,
final @Nullable String defaultValue) {
final String value = metadata.getString(key, defaultValue);
logger.log(SentryLevel.DEBUG, key + " read: " + value);
if (logger.isEnabled(SentryLevel.DEBUG)) {
logger.log(SentryLevel.DEBUG, key + " read: " + value);
}
return value;
}

Expand All @@ -799,14 +803,18 @@ private static boolean readBool(
final @NotNull String key,
final @NotNull String defaultValue) {
final String value = metadata.getString(key, defaultValue);
logger.log(SentryLevel.DEBUG, key + " read: " + value);
if (logger.isEnabled(SentryLevel.DEBUG)) {
logger.log(SentryLevel.DEBUG, key + " read: " + value);
}
return value;
}

private static @Nullable List<String> readList(
final @NotNull Bundle metadata, final @NotNull ILogger logger, final @NotNull String key) {
final String value = metadata.getString(key);
logger.log(SentryLevel.DEBUG, key + " read: " + value);
if (logger.isEnabled(SentryLevel.DEBUG)) {
logger.log(SentryLevel.DEBUG, key + " read: " + value);
}
if (value != null) {
return Arrays.asList(value.split(",", -1));
} else {
Expand All @@ -821,7 +829,9 @@ private static double readDouble(
if (value == -1) {
value = ((Integer) metadata.getInt(key, -1)).doubleValue();
}
logger.log(SentryLevel.DEBUG, key + " read: " + value);
if (logger.isEnabled(SentryLevel.DEBUG)) {
logger.log(SentryLevel.DEBUG, key + " read: " + value);
}
return value;
}

Expand All @@ -832,7 +842,9 @@ private static long readLong(
final long defaultValue) {
// manifest meta-data only reads int if the value is not big enough
final long value = metadata.getInt(key, (int) defaultValue);
logger.log(SentryLevel.DEBUG, key + " read: " + value);
if (logger.isEnabled(SentryLevel.DEBUG)) {
logger.log(SentryLevel.DEBUG, key + " read: " + value);
}
return value;
}

Expand Down
Loading