Add 'config_dev'

This commit is contained in:
JeremyStar™ 2024-04-07 21:42:39 +02:00
parent aab965df44
commit af80222276
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 4 additions and 1 deletions

View file

@ -3,9 +3,10 @@ extends Control
# Configuration for the configuration # Configuration for the configuration
var config: Node = Node.new() var config: Node = Node.new()
const config_path: String = "res://addons/besseretests_config.gd" 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 # Configuration
var config_dev: bool = false
var config_test_directory: String = "res://tests" var config_test_directory: String = "res://tests"
var config_log_level: int = 2 var config_log_level: int = 2
var config_log_format: String = "%color_start%%level% %origin%: %message%%color_end%" 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 message
print_rich(format) 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 # Crash
func lcrash(message: String, origin: String = "Bessere Tests") -> void: func lcrash(message: String, origin: String = "Bessere Tests") -> void:

View file

@ -1,5 +1,6 @@
extends Node extends Node
var dev: bool = true
var test_directory: String = "res://addons/besseretests/examples/" var test_directory: String = "res://addons/besseretests/examples/"
var log_level: int = 0 var log_level: int = 0
var log_format = null var log_format = null