When logging ints, floats, booleans and null, their types are not preserved and instead they are converted to strings.
This code:
class InventoryItem extends Resource:
@export var itemtype: int = 0
@export var metadata: Dictionary = {}
@export var quantity: int = 1
func _ready():
var d = {
"foobar": "bazqux",
5: 25,
3.14: 12e3,
true: false,
null: null,
"an object": InventoryItem.new(),
}
GodotLogger.info("this is an array", d)
results in the following output:
INFO [21/9/2023 22:57:53] this is an array {"foobar":"bazqux","5":"25","3.14":"12000","true":"false","<null>":"<null>","an object":"{"itemtype":0,"metadata":{},"quantity":1,"resource_local_to_scene":false,"resource_name":"","resource_path":""}"}
When logging ints, floats, booleans and null, their types are not preserved and instead they are converted to strings.
This code:
results in the following output:
INFO [21/9/2023 22:57:53] this is an array {"foobar":"bazqux","5":"25","3.14":"12000","true":"false","<null>":"<null>","an object":"{"itemtype":0,"metadata":{},"quantity":1,"resource_local_to_scene":false,"resource_name":"","resource_path":""}"}