Implement logger checks for preprocessor

This commit is contained in:
JeremyStar™ 2023-06-29 20:02:38 +02:00
parent 0653dc85bc
commit 1635e98a4c

View file

@ -30,7 +30,7 @@ func _ready() -> void:
func diag(script:String,message:String,preproc:bool = false) -> void:
if enable and enable_diag:
if preproc:
if preproc and Preprocessor.enabled:
var logmsg = "[color=gray](" + script + ") [DIAG] [b]" + preprocessor.pre(0,script,message) + "[/b][/color]"
print_rich(logmsg)
emit_signal("logevent","DIAG",script,message,logmsg)
@ -41,7 +41,7 @@ func diag(script:String,message:String,preproc:bool = false) -> void:
func info(script:String,message:String,preproc:bool = true) -> void:
if enable:
if preproc:
if preproc and Preprocessor.enabled:
var logmsg = "(" + script + ") [INFO] [b]" + preprocessor.pre(1,script,message) + "[/b]"
print_rich(logmsg)
emit_signal("logevent","INFO",script,message,logmsg)
@ -52,7 +52,7 @@ func info(script:String,message:String,preproc:bool = true) -> void:
func warn(script:String,message:String,preproc:bool = true) -> void:
if enable:
if preproc:
if preproc and Preprocessor.enabled:
var logmsg = "[color=orange](" + script + ") [WARN] [b]" + preprocessor.pre(2,script,message) + "[/b][/color]"
print_rich(logmsg)
emit_signal("logevent","WARN",script,message,logmsg)
@ -63,7 +63,7 @@ func warn(script:String,message:String,preproc:bool = true) -> void:
func error(script:String,message:String,preproc:bool = true) -> void:
if enable:
if preproc:
if preproc and Preprocessor.enabled:
var logmsg = "[color=red](" + script + ") [ERROR] [b]" + preprocessor.pre(3,script,message) + "[/b][/color]"
print_rich(logmsg)
emit_signal("logevent","ERROR",script,message,logmsg)