Make Test.gd more modern

This commit is contained in:
JeremyStar™ 2024-03-24 15:43:31 +01:00
parent 3760f674cb
commit 35cdadf74d

View file

@ -25,6 +25,8 @@ extends Node
var config: CoreConfiguration = CoreConfiguration.new() var config: CoreConfiguration = CoreConfiguration.new()
# CORE Object # CORE Object
var core: Core var core: Core
# Logger
@onready var logger: CoreLoggerInstance = core.logger.get_instance("Test.gd")
func _init() -> void: func _init() -> void:
configure_core() configure_core()
@ -34,10 +36,10 @@ func _init() -> void:
func _ready() -> void: func _ready() -> void:
# Inject CORE # Inject CORE
await get_tree().process_frame await get_tree().process_frame
add_child(core) get_tree().root.add_child(core)
await core.complete_init() await core.complete_init()
# Print information about CORE # 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 (semantic) = %release_semantic%
Release = %release% Release = %release%
Typerelease = %release_type% Typerelease = %release_type%
@ -47,7 +49,7 @@ Development mode = %devmode%
Headless mode = %headless% Headless mode = %headless%
Custom module support = %custommodules%""")) Custom module support = %custommodules%"""))
# Print hi # Print hi
core.logger.info("Test.gd", "Hi there!") logger.info("Hi there!")
# Update CORE configuration # Update CORE configuration
func configure_core() -> void: func configure_core() -> void: