Fix crash function crashing (lol)

This commit is contained in:
JeremyStar™ 2024-04-08 21:37:29 +02:00
parent 6bae282326
commit abcbce2dcd
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
3 changed files with 16 additions and 5 deletions

View file

@ -12,6 +12,11 @@ Pretty much a wrapper around CORE's logging implementation. CoreLoggerInstance's
Reference to CORE's logger module. Reference to CORE's logger module.
### *String* <u>origin</u> ### *String* <u>origin</u>
The origin argument. The origin argument.
### *String* <u>framework</u> = *false*
:::danger[Don't modify]
Do not modify this.
:::
For internal purposes only.
## Functions ## Functions
### *void* <u>_init</u>(*CoreBaseModule* <u>logger_new</u>, *String* <u>origin_new</u>) ### *void* <u>_init</u>(*CoreBaseModule* <u>logger_new</u>, *String* <u>origin_new</u>)

View file

@ -28,6 +28,9 @@ class_name CoreLoggerInstance
var logger: CoreBaseModule var logger: CoreBaseModule
## The origin argument. ## The origin argument.
var origin: String var origin: String
## For internal purposes only.
## [b]Note: [i]Don't modify.[/i][/b]
var framework: bool = false
## The instance constructor. ## The instance constructor.
func _init(logger_new: CoreBaseModule, origin_new: String) -> void: func _init(logger_new: CoreBaseModule, origin_new: String) -> void:
@ -46,4 +49,4 @@ func warn(message: String) -> void: logger.warn(origin, message)
func error(message: String) -> void: logger.error(origin, message) func error(message: String) -> void: logger.error(origin, message)
## Handles crashes. Will terminate your game/application immediately.[br] ## Handles crashes. Will terminate your game/application immediately.[br]
## [b]Note: [i]Using the [code]await[/code] keyword is required for this function.[/i][/b] ## [b]Note: [i]Using the [code]await[/code] keyword is required for this function.[/i][/b]
func crash(message: String) -> void: await logger.crash(origin, message) func crash(message: String) -> void: await logger.crash(origin, message, framework)

View file

@ -146,6 +146,8 @@ VIDEO
-> Adapter Information %video_adapter% -> Adapter Information %video_adapter%
+++ GODOT ENGINE INFORMATION +++ +++ GODOT ENGINE INFORMATION +++
ENGINE
-> Version %godot_version%
BUILD BUILD
-> Debug build %godot_debug% -> Debug build %godot_debug%
-> Sandboxed %godot_sandboxed% -> Sandboxed %godot_sandboxed%
@ -161,11 +163,11 @@ STACKTRACE
else: crash_message = crash_message.replace("%causer%", "The running application") else: crash_message = crash_message.replace("%causer%", "The running application")
crash_message = crash_message.replace("%origin%", origin) crash_message = crash_message.replace("%origin%", origin)
crash_message = crash_message.replace("%message%", message) crash_message = crash_message.replace("%message%", message)
crash_message = crash_message.replace("%version_release%", str(core.version_release)) crash_message = crash_message.replace("%version_release%", str(core.version_version))
crash_message = crash_message.replace("%version_type%", await core.get_formatted_string("%type%")) crash_message = crash_message.replace("%version_type%", await core.get_formatted_string("%version_type%"))
crash_message = crash_message.replace("%version_typerelease%", str(core.version_typerelease)) crash_message = crash_message.replace("%version_typerelease%", str(core.version_typerelease))
crash_message = crash_message.replace("%version_full%", str(core.version_release) + await core.get_formatted_string("-%type_technical%") + str(core.version_typerelease)) crash_message = crash_message.replace("%version_full%", str(core.version_version) + await core.get_formatted_string("-%version_type_technical%") + str(core.version_typerelease))
crash_message = crash_message.replace("%version_semantic%", await core.get_formatted_string("%release_semantic%")) crash_message = crash_message.replace("%version_semantic%", await core.get_formatted_string("%version_semantic%"))
crash_message = crash_message.replace("%devmode%", str(core.is_devmode())) crash_message = crash_message.replace("%devmode%", str(core.is_devmode()))
crash_message = crash_message.replace("%headless%", str(core.config.headless)) crash_message = crash_message.replace("%headless%", str(core.config.headless))
crash_message = crash_message.replace("%os%", OS.get_name()) crash_message = crash_message.replace("%os%", OS.get_name())
@ -181,6 +183,7 @@ STACKTRACE
crash_message = crash_message.replace("%processor_name%", OS.get_processor_name()) crash_message = crash_message.replace("%processor_name%", OS.get_processor_name())
crash_message = crash_message.replace("%processor_count%", str(OS.get_processor_count())) crash_message = crash_message.replace("%processor_count%", str(OS.get_processor_count()))
crash_message = crash_message.replace("%video_adapter%", str(OS.get_video_adapter_driver_info())) crash_message = crash_message.replace("%video_adapter%", str(OS.get_video_adapter_driver_info()))
crash_message = crash_message.replace("%godot_version%", str(Engine.get_version_info()["string"]))
crash_message = crash_message.replace("%godot_debug%", str(OS.is_debug_build())) crash_message = crash_message.replace("%godot_debug%", str(OS.is_debug_build()))
crash_message = crash_message.replace("%godot_sandboxed%", str(OS.is_sandboxed())) crash_message = crash_message.replace("%godot_sandboxed%", str(OS.is_sandboxed()))
crash_message = crash_message.replace("%godot_persistance%", str(OS.is_userfs_persistent())) crash_message = crash_message.replace("%godot_persistance%", str(OS.is_userfs_persistent()))