Fix RESU & CRSH messages not appearing
This commit is contained in:
parent
6479b02a46
commit
aab965df44
1 changed files with 5 additions and 5 deletions
|
@ -126,7 +126,7 @@ func print_results() -> void:
|
||||||
# +++ logging +++
|
# +++ logging +++
|
||||||
# Main logging function
|
# Main logging function
|
||||||
func _log(message: String, origin: String, level: int, sanitize: bool = true, level_name: String = "", level_color_start: String = "", level_color_end: String = "") -> void:
|
func _log(message: String, origin: String, level: int, sanitize: bool = true, level_name: String = "", level_color_start: String = "", level_color_end: String = "") -> void:
|
||||||
if level >= config_log_level:
|
if level == 505 or level >= config_log_level:
|
||||||
var format: String = config_log_format
|
var format: String = config_log_format
|
||||||
|
|
||||||
# Replace common placeholders
|
# Replace common placeholders
|
||||||
|
@ -136,7 +136,7 @@ func _log(message: String, origin: String, level: int, sanitize: bool = true, le
|
||||||
format = format.replace("%origin%", origin)
|
format = format.replace("%origin%", origin)
|
||||||
format = format.replace("%message%", message)
|
format = format.replace("%message%", message)
|
||||||
format = format.replace("%color%", "no!") # no!
|
format = format.replace("%color%", "no!") # no!
|
||||||
if level != NAN: # except when level is not a number
|
if level != 505: # except when level is not a number
|
||||||
format = format.replace("%color_start%", "[color=%color%]")
|
format = format.replace("%color_start%", "[color=%color%]")
|
||||||
format = format.replace("%color_end%", "[/color]")
|
format = format.replace("%color_end%", "[/color]")
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ func _log(message: String, origin: String, level: int, sanitize: bool = true, le
|
||||||
4:
|
4:
|
||||||
format = format.replace("%level%", "ERR!")
|
format = format.replace("%level%", "ERR!")
|
||||||
format = format.replace("%color%", "red")
|
format = format.replace("%color%", "red")
|
||||||
NAN:
|
505:
|
||||||
format = format.replace("%level%", level_name)
|
format = format.replace("%level%", level_name)
|
||||||
format = format.replace("%color_start%", level_color_start)
|
format = format.replace("%color_start%", level_color_start)
|
||||||
format = format.replace("%color_end%", level_color_end)
|
format = format.replace("%color_end%", level_color_end)
|
||||||
|
@ -171,11 +171,11 @@ func _log(message: String, origin: String, level: int, sanitize: bool = true, le
|
||||||
# Crash
|
# Crash
|
||||||
func lcrash(message: String, origin: String = "Bessere Tests") -> void:
|
func lcrash(message: String, origin: String = "Bessere Tests") -> void:
|
||||||
crashed = true
|
crashed = true
|
||||||
_log(message, origin, NAN, true, "CRSH", "[color=red][b]", "[/b][/color]")
|
_log(message, origin, 505, true, "CRSH", "[color=red][b]", "[/b][/color]")
|
||||||
await terminate(69)
|
await terminate(69)
|
||||||
|
|
||||||
# Self explanitory
|
# Self explanitory
|
||||||
func lresu(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, NAN, false, "RESU", "[color=white]", "[/color]")
|
func lresu(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, 505, false, "RESU", "[color=white]", "[/color]")
|
||||||
func ldiag(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, 0)
|
func ldiag(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, 0)
|
||||||
func lverb(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, 1)
|
func lverb(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, 1)
|
||||||
func linfo(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, 2)
|
func linfo(message: String, origin: String = "Bessere Tests") -> void: _log(message, origin, 2)
|
||||||
|
|
Loading…
Reference in a new issue