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:
parent
fa55e02180
commit
8706a6ab1a
1 changed files with 16 additions and 2 deletions
18
log.gd
18
log.gd
|
@ -3,8 +3,22 @@ class_name Log
|
||||||
## Logging utilities
|
## Logging utilities
|
||||||
|
|
||||||
|
|
||||||
## Print to standard output.
|
## Print to standard output in cyan.
|
||||||
##
|
##
|
||||||
## Pass self to the first parameter.
|
## Pass self to the first parameter.
|
||||||
static func p(obj: Node, message: String) -> void:
|
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])
|
||||||
|
|
Loading…
Reference in a new issue