Skip to content

Commit 9335ec3

Browse files
authored
Merge branch 'main' into dependabot/github_actions/codecov/codecov-action-4.6.0
2 parents e6dcd44 + 55ea3cc commit 9335ec3

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

.github/workflows/agp-matrix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959

6060
# We tried to use the cache action to cache gradle stuff, but it made tests slower and timeout
6161
- name: Run instrumentation tests
62-
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2
62+
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v2
6363
with:
6464
api-level: 30
6565
force-avd-creation: false

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Vendor `java.util.Random` and replace `java.security.SecureRandom` usages ([#3783](https://github.com/getsentry/sentry-java/pull/3783))
1414
- Fix potential ANRs due to NDK scope sync ([#3754](https://github.com/getsentry/sentry-java/pull/3754))
1515
- Fix potential ANRs due to NDK System.loadLibrary calls ([#3670](https://github.com/getsentry/sentry-java/pull/3670))
16+
- Fix slow `Log` calls on app startup ([#3793](https://github.com/getsentry/sentry-java/pull/3793))
1617

1718
## 7.15.0
1819

sentry-android-core/src/main/java/io/sentry/android/core/AndroidLogger.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ public void log(
2626
final @NotNull SentryLevel level,
2727
final @NotNull String message,
2828
final @Nullable Object... args) {
29-
Log.println(toLogcatLevel(level), tag, String.format(message, args));
29+
if (args == null || args.length == 0) {
30+
Log.println(toLogcatLevel(level), tag, message);
31+
} else {
32+
Log.println(toLogcatLevel(level), tag, String.format(message, args));
33+
}
3034
}
3135

3236
@SuppressWarnings("AnnotateFormatMethod")
@@ -36,7 +40,11 @@ public void log(
3640
final @Nullable Throwable throwable,
3741
final @NotNull String message,
3842
final @Nullable Object... args) {
39-
log(level, String.format(message, args), throwable);
43+
if (args == null || args.length == 0) {
44+
log(level, message, throwable);
45+
} else {
46+
log(level, String.format(message, args), throwable);
47+
}
4048
}
4149

4250
@Override

sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java

+8-9
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ private static boolean readBool(
437437
final @NotNull String key,
438438
final boolean defaultValue) {
439439
final boolean value = metadata.getBoolean(key, defaultValue);
440-
logger.log(SentryLevel.DEBUG, "%s read: %s", key, value);
440+
logger.log(SentryLevel.DEBUG, key + " read: " + value);
441441
return value;
442442
}
443443

@@ -450,10 +450,10 @@ private static boolean readBool(
450450
if (metadata.getSerializable(key) != null) {
451451
final boolean nonNullDefault = defaultValue == null ? false : true;
452452
final boolean bool = metadata.getBoolean(key, nonNullDefault);
453-
logger.log(SentryLevel.DEBUG, "%s read: %s", key, bool);
453+
logger.log(SentryLevel.DEBUG, key + " read: " + bool);
454454
return bool;
455455
} else {
456-
logger.log(SentryLevel.DEBUG, "%s used default %s", key, defaultValue);
456+
logger.log(SentryLevel.DEBUG, key + " used default " + defaultValue);
457457
return defaultValue;
458458
}
459459
}
@@ -464,7 +464,7 @@ private static boolean readBool(
464464
final @NotNull String key,
465465
final @Nullable String defaultValue) {
466466
final String value = metadata.getString(key, defaultValue);
467-
logger.log(SentryLevel.DEBUG, "%s read: %s", key, value);
467+
logger.log(SentryLevel.DEBUG, key + " read: " + value);
468468
return value;
469469
}
470470

@@ -474,14 +474,14 @@ private static boolean readBool(
474474
final @NotNull String key,
475475
final @NotNull String defaultValue) {
476476
final String value = metadata.getString(key, defaultValue);
477-
logger.log(SentryLevel.DEBUG, "%s read: %s", key, value);
477+
logger.log(SentryLevel.DEBUG, key + " read: " + value);
478478
return value;
479479
}
480480

481481
private static @Nullable List<String> readList(
482482
final @NotNull Bundle metadata, final @NotNull ILogger logger, final @NotNull String key) {
483483
final String value = metadata.getString(key);
484-
logger.log(SentryLevel.DEBUG, "%s read: %s", key, value);
484+
logger.log(SentryLevel.DEBUG, key + " read: " + value);
485485
if (value != null) {
486486
return Arrays.asList(value.split(",", -1));
487487
} else {
@@ -493,7 +493,7 @@ private static boolean readBool(
493493
final @NotNull Bundle metadata, final @NotNull ILogger logger, final @NotNull String key) {
494494
// manifest meta-data only reads float
495495
final Double value = ((Float) metadata.getFloat(key, -1)).doubleValue();
496-
logger.log(SentryLevel.DEBUG, "%s read: %s", key, value);
496+
logger.log(SentryLevel.DEBUG, key + " read: " + value);
497497
return value;
498498
}
499499

@@ -504,7 +504,7 @@ private static long readLong(
504504
final long defaultValue) {
505505
// manifest meta-data only reads int if the value is not big enough
506506
final long value = metadata.getInt(key, (int) defaultValue);
507-
logger.log(SentryLevel.DEBUG, "%s read: %s", key, value);
507+
logger.log(SentryLevel.DEBUG, key + " read: " + value);
508508
return value;
509509
}
510510

@@ -524,7 +524,6 @@ static boolean isAutoInit(final @NotNull Context context, final @NotNull ILogger
524524
if (metadata != null) {
525525
autoInit = readBool(metadata, logger, AUTO_INIT, true);
526526
}
527-
logger.log(SentryLevel.INFO, "Retrieving auto-init from AndroidManifest.xml");
528527
} catch (Throwable e) {
529528
logger.log(SentryLevel.ERROR, "Failed to read auto-init from android manifest metadata.", e);
530529
}

0 commit comments

Comments
 (0)