From 35cdadf74d39e03b59c153d7df7653a5bce7bd99 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 24 Mar 2024 15:43:31 +0100 Subject: [PATCH] Make Test.gd more modern --- Test.gd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Test.gd b/Test.gd index 4857d9f..26abb8e 100644 --- a/Test.gd +++ b/Test.gd @@ -25,6 +25,8 @@ extends Node var config: CoreConfiguration = CoreConfiguration.new() # CORE Object var core: Core +# Logger +@onready var logger: CoreLoggerInstance = core.logger.get_instance("Test.gd") func _init() -> void: configure_core() @@ -34,10 +36,10 @@ func _init() -> void: func _ready() -> void: # Inject CORE await get_tree().process_frame - add_child(core) + get_tree().root.add_child(core) await core.complete_init() # Print information about CORE - core.logger.info("Test.gd", await core.get_formatted_string("""Version information: + logger.info(await core.get_formatted_string("""Version information: Release (semantic) = %release_semantic% Release = %release% Typerelease = %release_type% @@ -47,7 +49,7 @@ Development mode = %devmode% Headless mode = %headless% Custom module support = %custommodules%""")) # Print hi - core.logger.info("Test.gd", "Hi there!") + logger.info("Hi there!") # Update CORE configuration func configure_core() -> void: