diff --git a/src/register_types.cpp b/src/register_types.cpp index 240c026a..969bf756 100644 --- a/src/register_types.cpp +++ b/src/register_types.cpp @@ -12,6 +12,7 @@ #include "sentry/sentry_options.h" #include "sentry/sentry_sdk.h" #include "sentry/sentry_user.h" +#include "sentry/util/print.h" #include #include @@ -37,8 +38,11 @@ using namespace sentry; void initialize_module(ModuleInitializationLevel p_level) { if (p_level == MODULE_INITIALIZATION_LEVEL_CORE) { + sentry::util::print_debug("init level core"); } else if (p_level == godot::MODULE_INITIALIZATION_LEVEL_SERVERS) { + sentry::util::print_debug("init level servers"); } else if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) { + sentry::util::print_debug("init level scene"); GDREGISTER_CLASS(SentryLoggerLimits); GDREGISTER_CLASS(SentryOptions); GDREGISTER_INTERNAL_CLASS(RuntimeConfig); @@ -67,6 +71,7 @@ void initialize_module(ModuleInitializationLevel p_level) { SentrySDK *sentry_singleton = memnew(SentrySDK); Engine::get_singleton()->register_singleton("SentrySDK", SentrySDK::get_singleton()); } else if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) { + sentry::util::print_debug("init level editor"); #ifdef TOOLS_ENABLED #ifndef WINDOWS_ENABLED GDREGISTER_INTERNAL_CLASS(SentryEditorExportPluginUnix); @@ -94,7 +99,7 @@ GDExtensionBool GDE_EXPORT gdextension_init(GDExtensionInterfaceGetProcAddress p init_obj.register_initializer(initialize_module); init_obj.register_terminator(uninitialize_module); - init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE); + init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_CORE); return init_obj.init(); } diff --git a/src/sentry/util/print.h b/src/sentry/util/print.h index 9fb7a5e4..86062a9f 100644 --- a/src/sentry/util/print.h +++ b/src/sentry/util/print.h @@ -13,10 +13,10 @@ namespace sentry::util { template void print(sentry::Level p_level, const Variant &p_arg1, const Args &...p_args) { - if (!SentryOptions::get_singleton()->is_debug_enabled() && p_level < sentry::LEVEL_ERROR) { + if (SentryOptions::get_singleton().is_valid() && !SentryOptions::get_singleton()->is_debug_enabled() && p_level < sentry::LEVEL_ERROR) { return; } - if (SentryOptions::get_singleton()->get_diagnostic_level() > p_level) { + if (SentryOptions::get_singleton().is_valid() && SentryOptions::get_singleton()->get_diagnostic_level() > p_level) { return; }