Merge pull request #39 from Excello-Recherche-Education/various-debug

Various debug
This commit is contained in:
Adrien Ufferte
2025-07-07 13:44:11 +02:00
committed by GitHub
3 changed files with 5 additions and 3 deletions
@@ -5,7 +5,7 @@ class_name ValidatorFunctions
static func matches(pattern: String, text: String) -> bool:
var regex = RegEx.create_from_string(pattern)
if not regex.is_valid():
print_debug("WARNING: Invalid RegEx pattern supplied to matches function: ", pattern)
Logger.debug("ValidatorFunctions: Invalid RegEx pattern supplied to matches function: %s" % pattern)
return false
var result = regex.search(text)
return result != null and result.strings.size() > 0
@@ -14,7 +14,7 @@ static func matches(pattern: String, text: String) -> bool:
static func does_not_match(pattern: String, text: String) -> bool:
var regex = RegEx.create_from_string(pattern)
if not regex.is_valid():
print_debug("WARNING: Invalid RegEx pattern supplied to matches function: ", pattern)
Logger.debug("ValidatorFunctions: Invalid RegEx pattern supplied to does_not_match function: %s" % pattern)
return false
var result = regex.search(text)
return result == null
+1 -1
View File
@@ -76,7 +76,7 @@ func _save_segments(segments: Array[SegmentBuild], path: String) -> void:
DirAccess.make_dir_recursive_absolute(Database.BASE_PATH.path_join(Database.language).path_join(Database.TRACING_DATA_FOLDER))
var file: FileAccess = FileAccess.open(real_path(path), FileAccess.WRITE)
for segment: SegmentBuild in segments:
var values: PackedStringArray
var values: PackedStringArray = []
for point: Vector2 in segment.points:
values.append(str(point.x) + " " + str(point.y))
file.store_csv_line(values)
+2
View File
@@ -96,6 +96,8 @@ func _log_internal(level: LogLevel, message: String) -> void:
var log_message: String = "%s %s %s" % [time_str, prefix, message]
match level:
LogLevel.DEBUG:
print_debug(log_message)
LogLevel.WARNING:
push_warning(log_message)
LogLevel.ERROR: