1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 15:44:23 +00:00

Add Log.w and Log.e function to print in yellow and red to the console respectively

This commit is contained in:
Steffo 2024-04-14 00:03:11 +02:00
parent fa55e02180
commit 8706a6ab1a
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

18
log.gd
View file

@ -3,8 +3,22 @@ class_name Log
## Logging utilities
## Print to standard output.
## Print to standard output in cyan.
##
## Pass self to the first parameter.
static func p(obj: Node, message: String) -> void:
print("[%s] %s" % [obj, message])
print_rich("[color=cyan]{%s} %s[/color]" % [obj, message])
## Print to standard output in yellow.
##
## Pass self to the first parameter.
static func w(obj: Node, message: String) -> void:
print_rich("[color=yellow]{%s} %s[/color]" % [obj, message])
## Print to standard output in red.
##
## Pass self to the first parameter.
static func e(obj: Node, message: String) -> void:
print_rich("[color=red]{%s} %s[/color]" % [obj, message])