Update Test.gd a bit

This commit is contained in:
JeremyStar™ 2024-04-08 20:15:00 +02:00
parent 5fed9c1f9b
commit 7e7fb03e54
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

22
Test.gd
View file

@ -22,16 +22,15 @@
## For more permanent tests write a unit test instead. ## For more permanent tests write a unit test instead.
extends Node extends Node
# CORE Configuration
var config: CoreConfiguration = CoreConfiguration.new()
# CORE Object
var core: Core var core: Core
# Logger var config: CoreConfiguration = CoreConfiguration.new()
@onready var logger: CoreLoggerInstance = core.logger.get_instance("Test.gd") @onready var logger: CoreLoggerInstance = core.logger.get_instance("Test.gd")
func _init() -> void: func _init() -> void:
configure_core() # Update config keys
config.headless = false
config.debugging = true
config.logger_level = CoreTypes.LoggerLevel.DIAG
# Initialize CORE with custom config # Initialize CORE with custom config
core = Core.new(config) core = Core.new(config)
@ -40,21 +39,16 @@ func _ready() -> void:
await get_tree().process_frame await get_tree().process_frame
get_tree().root.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
logger.info(await core.get_formatted_string("""Version information: logger.info(await core.get_formatted_string("""Version information:
Release (semantic) = %version_semantic% Release (semantic) = %version_semantic%
Release = %version% Release = %version%
Typerelease = %version_type% Typerelease = %version_type%
Type = %type% Type = %version_type%
Type (technical) = %type_technical% Type (technical) = %version_type_technical%
Development mode = %devmode% Development mode = %devmode%
Headless mode = %headless% Headless mode = %headless%
Custom module support = %custommodules%""")) Custom module support = %custommodules%"""))
# Print hi # Print hi
logger.info("Hi there!") logger.info("Hi there!")
# Update CORE configuration
func configure_core() -> void:
config.headless = false
config.debugging = true
config.logger_level = CoreTypes.LoggerLevel.DIAG