diff --git a/CHANGELOG.md b/CHANGELOG.md index 01cf5fa..2ba07b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features -- Create or modify events using `SentryEvent` objects and new SDK methods: `SentrySDK.capture_event(event)`, `SentrySDK.create_event()`, `SentrySDK.create_message_event()` ([#51](https://github.com/getsentry/sentry-godot/pull/51)) +- Create or modify events using `SentryEvent` objects and new SDK methods: `SentrySDK.create_event()`, `SentrySDK.capture_event(event)` ([#51](https://github.com/getsentry/sentry-godot/pull/51)) ## 0.0.3 diff --git a/project/test/test_event.gd b/project/test/test_event.gd index a05468f..9d92273 100644 --- a/project/test/test_event.gd +++ b/project/test/test_event.gd @@ -79,16 +79,3 @@ func test_capture_event() -> void: assert_str(event_id).is_equal(event.id) assert_str(SentrySDK.get_last_event_id()).is_not_empty() assert_str(event_id).is_equal(SentrySDK.get_last_event_id()) - - -## SentrySDK.create_message_event() should return a SentryEvent instance with the specified message and level, and should be able to be captured. -func test_create_message_event_and_capture() -> void: - var event := SentrySDK.create_message_event("Test message", SentrySDK.LEVEL_DEBUG, "custom-logger") - assert_str(event.message).is_equal("Test message") - assert_str(event.id).is_not_empty() - assert_int(event.level).is_equal(SentrySDK.LEVEL_DEBUG) - assert_str(event.logger).is_equal("custom-logger") - var event_id := SentrySDK.capture_event(event) - assert_str(event_id).is_not_empty() - assert_str(event_id).is_equal(event.id) - assert_str(event_id).is_equal(SentrySDK.get_last_event_id()) diff --git a/src/sentry/disabled_sdk.h b/src/sentry/disabled_sdk.h index e351fb2..239e8ae 100644 --- a/src/sentry/disabled_sdk.h +++ b/src/sentry/disabled_sdk.h @@ -25,7 +25,6 @@ class DisabledSDK : public InternalSDK { virtual String capture_error(const String &p_type, const String &p_value, Level p_level, const Vector &p_frames) override { return ""; } virtual Ref create_event() override { return memnew(DisabledEvent); } - virtual Ref create_message_event(const String &p_message, Level p_level = sentry::LEVEL_INFO, const String &p_logger = "") override { return memnew(DisabledEvent); }; virtual String capture_event(const Ref &p_event) override { return ""; } virtual void initialize() override {} diff --git a/src/sentry/internal_sdk.h b/src/sentry/internal_sdk.h index c64ce96..17e0122 100644 --- a/src/sentry/internal_sdk.h +++ b/src/sentry/internal_sdk.h @@ -46,7 +46,6 @@ class InternalSDK { virtual String capture_error(const String &p_type, const String &p_value, Level p_level, const Vector &p_frames) = 0; virtual Ref create_event() = 0; - virtual Ref create_message_event(const String &p_message, sentry::Level p_level, const String &p_logger = "") = 0; virtual String capture_event(const Ref &p_event) = 0; virtual void initialize() = 0; diff --git a/src/sentry/native/native_sdk.cpp b/src/sentry/native/native_sdk.cpp index e556cf7..1d916c0 100644 --- a/src/sentry/native/native_sdk.cpp +++ b/src/sentry/native/native_sdk.cpp @@ -177,15 +177,6 @@ Ref NativeSDK::create_event() { return event; } -Ref NativeSDK::create_message_event(const String &p_message, sentry::Level p_level, const String &p_logger) { - sentry_value_t event_value = sentry_value_new_message_event( - native::level_to_native(p_level), - p_logger.utf8().get_data(), - p_message.utf8().get_data()); - Ref event = memnew(NativeEvent(event_value)); - return event; -} - String NativeSDK::capture_event(const Ref &p_event) { last_uuid = sentry_uuid_nil(); ERR_FAIL_COND_V_MSG(p_event.is_null(), _uuid_as_string(last_uuid), "Sentry: Can't capture event - event object is null."); diff --git a/src/sentry/native/native_sdk.h b/src/sentry/native/native_sdk.h index 0f1e44c..28b5334 100644 --- a/src/sentry/native/native_sdk.h +++ b/src/sentry/native/native_sdk.h @@ -30,7 +30,6 @@ class NativeSDK : public InternalSDK { virtual String capture_error(const String &p_type, const String &p_value, Level p_level, const Vector &p_frames) override; virtual Ref create_event() override; - virtual Ref create_message_event(const String &p_message, Level p_level = sentry::LEVEL_INFO, const String &p_logger = "") override; virtual String capture_event(const Ref &p_event) override; virtual void initialize() override; diff --git a/src/sentry_sdk.cpp b/src/sentry_sdk.cpp index 5885ce2..cc75062 100644 --- a/src/sentry_sdk.cpp +++ b/src/sentry_sdk.cpp @@ -37,10 +37,6 @@ Ref SentrySDK::create_event() const { return internal_sdk->create_event(); } -Ref SentrySDK::create_message_event(const String &p_message, sentry::Level p_level, const String &p_logger) { - return internal_sdk->create_message_event(p_message, p_level, p_logger); -} - String SentrySDK::capture_event(const Ref &p_event) { ERR_FAIL_COND_V_MSG(p_event.is_null(), "", "Sentry: Can't capture event - event object is null."); return internal_sdk->capture_event(p_event); @@ -112,7 +108,6 @@ void SentrySDK::_bind_methods() { ClassDB::bind_method(D_METHOD("get_user"), &SentrySDK::get_user); ClassDB::bind_method(D_METHOD("remove_user"), &SentrySDK::remove_user); ClassDB::bind_method(D_METHOD("create_event"), &SentrySDK::create_event); - ClassDB::bind_method(D_METHOD("create_message_event", "message", "level", "logger"), &SentrySDK::create_message_event, DEFVAL(LEVEL_INFO), DEFVAL("")); ClassDB::bind_method(D_METHOD("capture_event", "event"), &SentrySDK::capture_event); } diff --git a/src/sentry_sdk.h b/src/sentry_sdk.h index 416abfa..b63325a 100644 --- a/src/sentry_sdk.h +++ b/src/sentry_sdk.h @@ -58,7 +58,6 @@ class SentrySDK : public Object { String get_last_event_id() const; Ref create_event() const; - Ref create_message_event(const String &p_message, sentry::Level p_level = sentry::LEVEL_INFO, const String &p_logger = ""); String capture_event(const Ref &p_event); SentrySDK();