Skip to content

Commit aeec682

Browse files
committed
move already initialized log message
1 parent d2bd58e commit aeec682

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sentry/src/main/java/io/sentry/Sentry.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,6 @@ private static synchronized void init(
272272
"You are running Android. Please, use SentryAndroid.init. "
273273
+ options.getClass().getName());
274274
}
275-
if (isEnabled()) {
276-
options
277-
.getLogger()
278-
.log(
279-
SentryLevel.WARNING,
280-
"Sentry has been already initialized. Previous configuration will be overwritten.");
281-
}
282275

283276
if (!preInitConfigurations(options)) {
284277
return;
@@ -288,6 +281,13 @@ private static synchronized void init(
288281
Sentry.globalHubMode = globalHubMode;
289282
final boolean shouldInit = InitUtil.shouldInit(globalScope.getOptions(), options, isEnabled());
290283
if (shouldInit) {
284+
if (isEnabled()) {
285+
options
286+
.getLogger()
287+
.log(
288+
SentryLevel.WARNING,
289+
"Sentry has been already initialized. Previous configuration will be overwritten.");
290+
}
291291
globalScope.replaceOptions(options);
292292

293293
final IScopes scopes = getCurrentScopes();

0 commit comments

Comments
 (0)