File tree Expand file tree Collapse file tree
sentry-jul/src/test/kotlin/io/sentry/jul
sentry-log4j2/src/test/kotlin/io/sentry/log4j2
sentry-logback/src/test/kotlin/io/sentry/logback
sentry/src/main/java/io/sentry Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io.sentry.jul
22
3+ import io.sentry.InitPriority
34import io.sentry.Sentry
45import io.sentry.SentryLevel
56import io.sentry.SentryOptions
@@ -57,13 +58,14 @@ class SentryHandlerTest {
5758 }
5859
5960 @Test
60- fun `does not initialize Sentry if Sentry is already enabled` () {
61+ fun `does not initialize Sentry if Sentry is already enabled with higher prio ` () {
6162 val transport = mock<ITransport >()
6263 Sentry .init {
6364 it.dsn = " http://key@localhost/proj"
6465 it.environment = " manual-environment"
6566 it.setTransportFactory { _, _ -> transport }
6667 it.isEnableBackpressureHandling = false
68+ it.initPriority = InitPriority .LOW
6769 }
6870 fixture = Fixture (transport = transport)
6971 fixture.logger.severe(" testing environment field" )
Original file line number Diff line number Diff line change 11package io.sentry.log4j2
22
33import io.sentry.ITransportFactory
4+ import io.sentry.InitPriority
45import io.sentry.ScopesAdapter
56import io.sentry.Sentry
67import io.sentry.SentryLevel
@@ -82,12 +83,13 @@ class SentryAppenderTest {
8283 }
8384
8485 @Test
85- fun `does not initialize Sentry if Sentry is already enabled` () {
86+ fun `does not initialize Sentry if Sentry is already enabled with higher prio ` () {
8687 Sentry .init {
8788 it.dsn = " http://key@localhost/proj"
8889 it.environment = " manual-environment"
8990 it.setTransportFactory(fixture.transportFactory)
9091 it.isEnableBackpressureHandling = false
92+ it.initPriority = InitPriority .LOW
9193 }
9294 val logger = fixture.getSut()
9395 logger.error(" testing environment field" )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import ch.qos.logback.core.encoder.Encoder
88import ch.qos.logback.core.encoder.EncoderBase
99import ch.qos.logback.core.status.Status
1010import io.sentry.ITransportFactory
11+ import io.sentry.InitPriority
1112import io.sentry.Sentry
1213import io.sentry.SentryLevel
1314import io.sentry.SentryOptions
@@ -88,7 +89,7 @@ class SentryAppenderTest {
8889 }
8990
9091 @Test
91- fun `does not initialize Sentry if Sentry is already enabled` () {
92+ fun `does not initialize Sentry if Sentry is already enabled with higher prio ` () {
9293 fixture = Fixture (
9394 startLater = true ,
9495 options = SentryOptions ().also {
@@ -101,6 +102,7 @@ class SentryAppenderTest {
101102 it.setTransportFactory(fixture.transportFactory)
102103 it.setTag(" tag-from-first-init" , " some-value" )
103104 it.isEnableBackpressureHandling = false
105+ it.initPriority = InitPriority .LOW
104106 }
105107 fixture.start()
106108
Original file line number Diff line number Diff line change @@ -2593,7 +2593,6 @@ public SentryOptions() {
25932593 */
25942594 private SentryOptions (final boolean empty ) {
25952595 if (!empty ) {
2596- setInitPriority (InitPriority .LOWEST );
25972596 setSpanFactory (new DefaultSpanFactory ());
25982597 // SentryExecutorService should be initialized before any
25992598 // SendCachedEventFireAndForgetIntegration
You can’t perform that action at this time.
0 commit comments