feature allow error report to sentry don't be limited by the flags

This commit is contained in:
alves
2025-12-25 14:49:30 +08:00
parent c6b878b2b7
commit a0fe85744a

View File

@@ -57,11 +57,7 @@ static sentry_value_t on_crash_callback(const sentry_ucontext_t* uctx, sentry_va
static sentry_value_t before_send(sentry_value_t event, void* hint, void* data)
{
if (!get_privacy_policy())
{
sentry_value_decref(event);
return sentry_value_new_null();
}
sentry_value_t level_val = sentry_value_get_by_key(event, SENTRY_KEY_LEVEL);
std::string levelName = sentry_value_as_string(level_val);
@@ -88,6 +84,12 @@ static sentry_value_t before_send(sentry_value_t event, void* hint, void* data)
}
}
if (!get_privacy_policy() && levelName == SENTRY_EVENT_TRACE) {
sentry_value_decref(event);
return sentry_value_new_null();
}
if (SENTRY_EVENT_FATAL == eventLevel ||
SENTRY_EVENT_ERROR == eventLevel ||
SENTRY_EVENT_TRACE == eventLevel)