Make log colors different when not invoked by cmd.gd
This commit is contained in:
parent
c04e6246a4
commit
b52acbba84
2 changed files with 10 additions and 3 deletions
|
@ -2,4 +2,6 @@ extends SceneTree
|
|||
|
||||
var scene: Node = load("res://addons/besseretests/scenesrc/runtimescene.tscn").instantiate()
|
||||
|
||||
func _initialize() -> void: root.add_child(scene)
|
||||
func _initialize() -> void:
|
||||
scene.internal_cmdline = true
|
||||
root.add_child(scene)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
extends Control
|
||||
|
||||
# Internal
|
||||
var internal_cmdline: bool = false
|
||||
|
||||
# Configuration for the configuration
|
||||
var config: Node = Node.new()
|
||||
const config_path: String = "res://addons/besseretests_config.gd"
|
||||
|
@ -162,10 +165,12 @@ func _log(message: String, origin: String, level: int, sanitize: bool = true, le
|
|||
match(level):
|
||||
0:
|
||||
format = format.replace("%level%", "DIAG")
|
||||
format = format.replace("%color%", "gray")
|
||||
if internal_cmdline: format = format.replace("%color%", "gray")
|
||||
else: format = format.replace("%color%", "light_gray")
|
||||
1:
|
||||
format = format.replace("%level%", "VERB")
|
||||
format = format.replace("%color%", "gray")
|
||||
if internal_cmdline: format = format.replace("%color%", "gray")
|
||||
else: format = format.replace("%color%", "dark_gray")
|
||||
2:
|
||||
format = format.replace("%level%", "INFO")
|
||||
format = format.replace("%color%", "white")
|
||||
|
|
Loading…
Reference in a new issue