Skip to content

Commit c3bef3c

Browse files
committed
Add debug logging to module initialization steps
1 parent 78562c5 commit c3bef3c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/register_types.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "sentry/sentry_options.h"
1313
#include "sentry/sentry_sdk.h"
1414
#include "sentry/sentry_user.h"
15+
#include "sentry/util/print.h"
1516

1617
#include <godot_cpp/classes/engine.hpp>
1718
#include <godot_cpp/classes/scene_tree.hpp>
@@ -37,8 +38,11 @@ using namespace sentry;
3738

3839
void initialize_module(ModuleInitializationLevel p_level) {
3940
if (p_level == MODULE_INITIALIZATION_LEVEL_CORE) {
41+
sentry::util::print_debug("init level core");
4042
} else if (p_level == godot::MODULE_INITIALIZATION_LEVEL_SERVERS) {
43+
sentry::util::print_debug("init level servers");
4144
} else if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
45+
sentry::util::print_debug("init level scene");
4246
GDREGISTER_CLASS(SentryLoggerLimits);
4347
GDREGISTER_CLASS(SentryOptions);
4448
GDREGISTER_INTERNAL_CLASS(RuntimeConfig);
@@ -67,6 +71,7 @@ void initialize_module(ModuleInitializationLevel p_level) {
6771
SentrySDK *sentry_singleton = memnew(SentrySDK);
6872
Engine::get_singleton()->register_singleton("SentrySDK", SentrySDK::get_singleton());
6973
} else if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
74+
sentry::util::print_debug("init level editor");
7075
#ifdef TOOLS_ENABLED
7176
#ifndef WINDOWS_ENABLED
7277
GDREGISTER_INTERNAL_CLASS(SentryEditorExportPluginUnix);
@@ -94,7 +99,7 @@ GDExtensionBool GDE_EXPORT gdextension_init(GDExtensionInterfaceGetProcAddress p
9499

95100
init_obj.register_initializer(initialize_module);
96101
init_obj.register_terminator(uninitialize_module);
97-
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
102+
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_CORE);
98103

99104
return init_obj.init();
100105
}

0 commit comments

Comments
 (0)