From af802222767b7d1b5c1bbcf2ff976074887251be Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 7 Apr 2024 21:42:39 +0200 Subject: [PATCH] Add 'config_dev' --- addons/besseretests/src/runtimescene.gd | 4 +++- addons/besseretests_config.gd | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/besseretests/src/runtimescene.gd b/addons/besseretests/src/runtimescene.gd index 4141c0a..0f40b8d 100644 --- a/addons/besseretests/src/runtimescene.gd +++ b/addons/besseretests/src/runtimescene.gd @@ -3,9 +3,10 @@ extends Control # Configuration for the configuration var config: Node = Node.new() const config_path: String = "res://addons/besseretests_config.gd" -const config_keys: Dictionary = { "test_directory": TYPE_STRING, "log_level": TYPE_INT, "log_format": TYPE_STRING, "print_orphan_nodes": TYPE_BOOL } +const config_keys: Dictionary = { "dev": TYPE_BOOL, "test_directory": TYPE_STRING, "log_level": TYPE_INT, "log_format": TYPE_STRING, "print_orphan_nodes": TYPE_BOOL } # Configuration +var config_dev: bool = false var config_test_directory: String = "res://tests" var config_log_level: int = 2 var config_log_format: String = "%color_start%%level% %origin%: %message%%color_end%" @@ -167,6 +168,7 @@ func _log(message: String, origin: String, level: int, sanitize: bool = true, le # Print message print_rich(format) + else: if config_dev: printerr("Rejected level='" + str(level) + "' sanitize='" + str(sanitize) + "' level_name='" + level_name + "' level_color_start='" + level_color_start + "' level_color_end='" + level_color_end + "' origin='" + origin + "' message='" + message + "'") # Crash func lcrash(message: String, origin: String = "Bessere Tests") -> void: diff --git a/addons/besseretests_config.gd b/addons/besseretests_config.gd index 5d8d143..4139916 100644 --- a/addons/besseretests_config.gd +++ b/addons/besseretests_config.gd @@ -1,5 +1,6 @@ extends Node +var dev: bool = true var test_directory: String = "res://addons/besseretests/examples/" var log_level: int = 0 var log_format = null