diff --git a/Sources/Sentry/Profiling/SentryLaunchProfiling.m b/Sources/Sentry/Profiling/SentryLaunchProfiling.m index 267c9833b7..fc6a2b657d 100644 --- a/Sources/Sentry/Profiling/SentryLaunchProfiling.m +++ b/Sources/Sentry/Profiling/SentryLaunchProfiling.m @@ -104,8 +104,8 @@ NSNumber *sampleRand = launchConfigDict[kSentryLaunchProfileConfigKeyProfilesSampleRand]; if (sampleRand == nil) { - SENTRY_TEST_FATAL(@"Tried to start a continuous profile v2 with no configured sample " - @"rate/rand. Will not run profiler."); + SENTRY_LOG_ERROR(@"Tried to start a continuous profile v2 with no configured sample " + @"rate/rand. Will not run profiler."); return; } @@ -358,7 +358,7 @@ NSNumber *lifecycleValue = persistedLaunchConfigOptionsDict [kSentryLaunchProfileConfigKeyContinuousProfilingV2Lifecycle]; if (lifecycleValue == nil) { - SENTRY_TEST_FATAL( + SENTRY_LOG_ERROR( @"Missing expected launch profile config parameter for lifecycle. Will " @"not proceed with launch profile."); _sentry_cleanUpConfigFile(); diff --git a/Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm b/Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm index 3726ed348c..b87abb6fbe 100644 --- a/Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm +++ b/Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm @@ -80,11 +80,6 @@ _unsafe_cleanUpContinuousProfilerV2() { if (_gInFlightRootSpans == 0) { - // This log message has been changed from an assertion failing in debug builds and tests to - // be less disruptive. This needs to be investigated because spans should not be finished - // multiple times. - // - // See https://github.com/getsentry/sentry-cocoa/pull/5363 for the full context. SENTRY_LOG_ERROR(@"Attemtpted to stop continuous profiler with no root spans in flight."); } else { _gInFlightRootSpans -= 1; @@ -104,7 +99,7 @@ std::lock_guard l(_gStateLock); if (![SentryContinuousProfiler isCurrentlyProfiling] && _gInFlightRootSpans != 0) { - SENTRY_TEST_FATAL(@"Unbalanced tracking of root spans and profiler detected."); + SENTRY_LOG_ERROR(@"Unbalanced tracking of root spans and profiler detected."); return; } @@ -183,13 +178,13 @@ _unsafe_cleanUpContinuousProfilerV2(); } else if (internalTraceId != nil) { if (sentry_isContinuousProfilingEnabled(hub.getClient)) { - SENTRY_TEST_FATAL(@"Tracers are not tracked with continuous profiling V1."); + SENTRY_LOG_ERROR(@"Tracers are not tracked with continuous profiling V1."); return; } if (_gTracersToProfilers == nil) { - SENTRY_TEST_FATAL(@"Tracer to profiler should have already been initialized by the " - @"time they are being queried"); + SENTRY_LOG_ERROR(@"Tracer to profiler should have already been initialized by the " + @"time they are being queried"); } const auto tracerKey = sentry_stringFromSentryID(internalTraceId); @@ -203,8 +198,8 @@ # if SENTRY_HAS_UIKIT if (_gProfilersToTracers == nil) { - SENTRY_TEST_FATAL(@"Profiler to tracer structure should have already been " - @"initialized by the time they are being queried"); + SENTRY_LOG_ERROR(@"Profiler to tracer structure should have already been " + @"initialized by the time they are being queried"); } if (_gProfilersToTracers.count == 0) { [SentryDependencyContainer.sharedInstance.framesTracker resetProfilingTimestamps]; diff --git a/Sources/Sentry/include/SentryInternalDefines.h b/Sources/Sentry/include/SentryInternalDefines.h index 51e2a62acc..b54acc56a8 100644 --- a/Sources/Sentry/include/SentryInternalDefines.h +++ b/Sources/Sentry/include/SentryInternalDefines.h @@ -27,17 +27,6 @@ static NSString *const SentryPlatformName = @"cocoa"; SENTRY_LOG_WARN(__VA_ARGS__); \ NSAssert(NO, __VA_ARGS__); -/** - * Abort in test, log a warning otherwise. Meant to help us fail faster in our own development, but - * never crash customers because since it's not something they can control with their own - * configuration. - */ -#if SENTRY_TEST || SENTRY_TEST_CI -# define SENTRY_TEST_FATAL(...) SENTRY_CASSERT(NO, __VA_ARGS__) -#else -# define SENTRY_TEST_FATAL(...) SENTRY_LOG_WARN(__VA_ARGS__) -#endif // SENTRY_TEST || SENTRY_TEST_CI - /** * Abort if assertion fails in debug, and log a warning if it fails in production. */