Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## Breaking changes

- Remove `disabled_in_editor` option in favor of disabling SDK in the Godot editor by default.([#277](https://github.com/getsentry/sentry-godot/pull/277))

### Fixes

- Prevent feedback loops in SentryLogger ([#275](https://github.com/getsentry/sentry-godot/pull/275))
Expand Down
5 changes: 1 addition & 4 deletions doc_classes/SentryOptions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@
<member name="diagnostic_level" type="int" setter="set_diagnostic_level" getter="get_diagnostic_level" enum="SentrySDK.Level" default="0">
Specifies the minimum level of messages to be printed if [member debug] is enabled.
</member>
<member name="disabled_in_editor" type="bool" setter="set_disabled_in_editor" getter="is_disabled_in_editor" default="true">
If [code]true[/code], the SDK will not initialize in the Godot editor.
</member>
<member name="disabled_in_editor_play" type="bool" setter="set_disabled_in_editor_play" getter="is_disabled_in_editor_play" default="false">
If [code]true[/code], the SDK will not initialize when the project is run from within the Godot editor. This differs from [member disabled_in_editor] which prevents initialization when working in the editor itself.
If [code]true[/code], the SDK will not initialize when you play/run your project from within the Godot editor (using the play button or F5).
</member>
<member name="dist" type="String" setter="set_dist" getter="get_dist" default="&quot;&quot;">
The application's distribution. Distributions are used to disambiguate build or deployment variants of the same release of an application.
Expand Down
4 changes: 0 additions & 4 deletions src/sentry/sentry_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ void SentryOptions::_define_project_settings(const Ref<SentryOptions> &p_options
ERR_FAIL_NULL(ProjectSettings::get_singleton());

_define_setting("sentry/options/enabled", p_options->enabled);
_define_setting("sentry/options/disabled_in_editor", p_options->disabled_in_editor, false);
_define_setting("sentry/options/disabled_in_editor_play", p_options->disabled_in_editor_play);
_requires_restart("sentry/options/disabled_in_editor");
_define_setting("sentry/options/dsn", p_options->dsn);
_define_setting("sentry/options/release", p_options->release, false);
_define_setting("sentry/options/dist", p_options->dist, false);
Expand Down Expand Up @@ -94,7 +92,6 @@ void SentryOptions::_load_project_settings(const Ref<SentryOptions> &p_options)
ERR_FAIL_NULL(ProjectSettings::get_singleton());

p_options->enabled = ProjectSettings::get_singleton()->get_setting("sentry/options/enabled", p_options->enabled);
p_options->disabled_in_editor = ProjectSettings::get_singleton()->get_setting("sentry/options/disabled_in_editor", p_options->disabled_in_editor);
p_options->disabled_in_editor_play = ProjectSettings::get_singleton()->get_setting("sentry/options/disabled_in_editor_play", p_options->disabled_in_editor_play);
p_options->dsn = ProjectSettings::get_singleton()->get_setting("sentry/options/dsn", p_options->dsn);
p_options->set_release(ProjectSettings::get_singleton()->get_setting("sentry/options/release", p_options->release));
Expand Down Expand Up @@ -179,7 +176,6 @@ void SentryOptions::remove_event_processor(const Ref<SentryEventProcessor> &p_pr

void SentryOptions::_bind_methods() {
BIND_PROPERTY(SentryOptions, PropertyInfo(Variant::BOOL, "enabled"), set_enabled, is_enabled);
BIND_PROPERTY(SentryOptions, PropertyInfo(Variant::BOOL, "disabled_in_editor"), set_disabled_in_editor, is_disabled_in_editor);
BIND_PROPERTY(SentryOptions, PropertyInfo(Variant::BOOL, "disabled_in_editor_play"), set_disabled_in_editor_play, is_disabled_in_editor_play);
BIND_PROPERTY(SentryOptions, PropertyInfo(Variant::STRING, "dsn"), set_dsn, get_dsn);
BIND_PROPERTY(SentryOptions, PropertyInfo(Variant::STRING, "release"), set_release, get_release);
Expand Down
4 changes: 0 additions & 4 deletions src/sentry/sentry_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class SentryOptions : public RefCounted {
static constexpr DebugMode DEBUG_DEFAULT = DebugMode::DEBUG_AUTO;

bool enabled = true;
bool disabled_in_editor = true;
bool disabled_in_editor_play = false;
String dsn = "";
String release = "{app_name}@{app_version}";
Expand Down Expand Up @@ -95,9 +94,6 @@ class SentryOptions : public RefCounted {
_FORCE_INLINE_ bool is_enabled() const { return enabled; }
_FORCE_INLINE_ void set_enabled(bool p_enabled) { enabled = p_enabled; }

_FORCE_INLINE_ bool is_disabled_in_editor() const { return disabled_in_editor; }
_FORCE_INLINE_ void set_disabled_in_editor(bool p_disabled_in_editor) { disabled_in_editor = p_disabled_in_editor; }

_FORCE_INLINE_ bool is_disabled_in_editor_play() const { return disabled_in_editor_play; }
_FORCE_INLINE_ void set_disabled_in_editor_play(bool p_disabled_in_editor_play) { disabled_in_editor_play = p_disabled_in_editor_play; }

Expand Down
6 changes: 3 additions & 3 deletions src/sentry/sentry_sdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ void SentrySDK::_initialize() {
sentry::util::print_debug("Sentry SDK is disabled in options.");
}

if (Engine::get_singleton()->is_editor_hint() && SentryOptions::get_singleton()->is_disabled_in_editor()) {
if (Engine::get_singleton()->is_editor_hint()) {
should_enable = false;
sentry::util::print_debug("Sentry SDK is disabled in the editor. Tip: This can be changed in the project settings.");
sentry::util::print_debug("Sentry SDK is disabled in the editor.");
}

if (!Engine::get_singleton()->is_editor_hint() && OS::get_singleton()->has_feature("editor") && SentryOptions::get_singleton()->is_disabled_in_editor_play()) {
should_enable = false;
sentry::util::print_debug("Sentry SDK is disabled during editor play. Tip: This can be changed in the project settings.");
sentry::util::print_debug("Sentry SDK is disabled when project is played from the editor. Tip: This can be changed in the project settings.");
}

if (should_enable) {
Expand Down
Loading