diff options
| author | radiohotline <radoihotline@disroot.rg> | 2026-08-25 16:33:56 +0300 |
|---|---|---|
| committer | radiohotline <radoihotline@disroot.rg> | 2026-08-25 16:33:56 +0300 |
| commit | a89e744ed0e8c759caf041a580112365bbfe4303 (patch) | |
| tree | dd61e320904176995727e86a857d00c90d4933ba /addons/gdUnit4/src/monitor/ErrorLogEntry.gd | |
| parent | 6d53d8cac78250dc888aa49d5f9d4175c6652feb (diff) | |
Diffstat (limited to 'addons/gdUnit4/src/monitor/ErrorLogEntry.gd')
| -rw-r--r-- | addons/gdUnit4/src/monitor/ErrorLogEntry.gd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/addons/gdUnit4/src/monitor/ErrorLogEntry.gd b/addons/gdUnit4/src/monitor/ErrorLogEntry.gd new file mode 100644 index 0000000..ebbc93f --- /dev/null +++ b/addons/gdUnit4/src/monitor/ErrorLogEntry.gd @@ -0,0 +1,41 @@ +extends RefCounted +class_name ErrorLogEntry + + +enum TYPE { + SCRIPT_ERROR, + PUSH_ERROR, + PUSH_WARNING +} + + +const GdUnitTools := preload("res://addons/gdUnit4/src/core/GdUnitTools.gd") + + +var _type: TYPE +var _line: int +var _message: String +var _details: String + + +func _init(type: TYPE, line: int, message: String, details: String) -> void: + _type = type + _line = line + _message = message + _details = details + + +func _to_string() -> String: + return _message + + +static func of_push_warning(line: int, message: String, stack_trace: PackedStringArray) -> ErrorLogEntry: + return ErrorLogEntry.new(TYPE.PUSH_WARNING, line, message, "\n".join(stack_trace)) + + +static func of_push_error(line: int, message: String, stack_trace: PackedStringArray) -> ErrorLogEntry: + return ErrorLogEntry.new(TYPE.PUSH_ERROR, line, message, "\n".join(stack_trace)) + + +static func of_script_error(line: int, message: String, stack_trace: PackedStringArray) -> ErrorLogEntry: + return ErrorLogEntry.new(TYPE.SCRIPT_ERROR, line, message, "\n".join(stack_trace)) |
