Skip to content

Commit 50f868a

Browse files
committed
Improve spy log in extensions for gd_object_t parameters
1 parent 879f044 commit 50f868a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/_pythonscript_extension_class_language.pxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ cdef class PythonScriptLanguage:
4646
# godot_extension: method(virtual=True, const=True)
4747
cdef gd_dictionary_t _complete_code(self, gd_string_t code, gd_string_t path, gd_object_t owner):
4848
# TODO
49-
spy_log(f"CALLED PythonScriptLanguage::_complete_code(code={gdapi.gd_string_to_pystr(&code)!r}, path={gdapi.gd_string_to_pystr(&path)!r}, owner=<object>)")
49+
spy_log(f"CALLED PythonScriptLanguage::_complete_code(code={gdapi.gd_string_to_pystr(&code)!r}, path={gdapi.gd_string_to_pystr(&path)!r}, owner=<object 0x{<size_t>owner:x}>)")
5050
cdef gd_dictionary_t ret = gd_dictionary_new()
5151
gd_string_del(&code)
5252
gd_string_del(&path)
@@ -360,7 +360,7 @@ cdef class PythonScriptLanguage:
360360
# godot_extension: method(virtual=True, const=True)
361361
cdef gd_dictionary_t _lookup_code(self, gd_string_t code, gd_string_t symbol, gd_string_t path, gd_object_t owner):
362362
# TODO
363-
spy_log(f"CALLED PythonScriptLanguage::_lookup_code(code={gdapi.gd_string_to_pystr(&code)!r}, symbol={gdapi.gd_string_to_pystr(&symbol)!r}, path={gdapi.gd_string_to_pystr(&path)!r}, owner=<object>)")
363+
spy_log(f"CALLED PythonScriptLanguage::_lookup_code(code={gdapi.gd_string_to_pystr(&code)!r}, symbol={gdapi.gd_string_to_pystr(&symbol)!r}, path={gdapi.gd_string_to_pystr(&path)!r}, owner=<object 0x{<size_t>owner:x}>)")
364364
gd_string_del(&code)
365365
gd_string_del(&symbol)
366366
gd_string_del(&path)
@@ -426,7 +426,7 @@ class {py_class_name}({py_base_class_name}):
426426
# godot_extension: method(virtual=True)
427427
cdef gd_int_t _open_in_external_editor(self, gd_object_t script, gd_int_t line, gd_int_t column):
428428
# TODO
429-
spy_log(f"CALLED PythonScriptLanguage::_open_in_external_editor(script=<object>, line={line}, column={column})")
429+
spy_log(f"CALLED PythonScriptLanguage::_open_in_external_editor(script=<object 0x{<size_t>script:x}>, line={line}, column={column})")
430430
# `gd_object_t` doesn't need to be be deleted (is it just a raw pointer)
431431
return Error.ERR_UNAVAILABLE
432432

@@ -484,7 +484,7 @@ class {py_class_name}({py_base_class_name}):
484484
# godot_extension: method(virtual=True)
485485
cdef void _reload_tool_script(self, gd_object_t script, gd_bool_t soft_reload):
486486
# TODO
487-
spy_log(f"CALLED PythonScriptLanguage::_reload_tool_script(script=<object>, soft_reload={soft_reload})")
487+
spy_log(f"CALLED PythonScriptLanguage::_reload_tool_script(script=<object 0x{<size_t>script:x}>, soft_reload={soft_reload})")
488488
# `gd_object_t` doesn't need to be be deleted (is it just a raw pointer)
489489

490490
# godot_extension: method(virtual=True)

src/_pythonscript_extension_class_script.pxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ cdef class PythonScript:
178178

179179
# godot_extension: method(virtual=True, const=True)
180180
cdef gd_bool_t _inherits_script(self, gd_object_t script):
181-
spy_log(f"CALLED PythonScript::_inherits_script(script=<object>)")
181+
spy_log(f"CALLED PythonScript::_inherits_script(script=<object 0x{<size_t>script:x}>)")
182182
# TODO
183183
# `gd_object_t` doesn't need to be be deleted (is it just a raw pointer)
184184
return False
185185

186186
# godot_extension: method(virtual=True, const=True)
187187
cdef void* _instance_create(self, gd_object_t for_object):
188-
spy_log(f"CALLED PythonScript::_instance_create(for_object=<object>)")
188+
spy_log(f"CALLED PythonScript::_instance_create(for_object=<object 0x{<size_t>for_object:x}>)")
189189
# For now, return NULL as we don't have full instance support yet
190190
# This would need to create a Python script instance that can
191191
# execute the script code and handle Godot callbacks
@@ -194,7 +194,7 @@ cdef class PythonScript:
194194

195195
# godot_extension: method(virtual=True, const=True)
196196
cdef gd_bool_t _instance_has(self, gd_object_t object):
197-
spy_log(f"CALLED PythonScript::_instance_has(object=<object>)")
197+
spy_log(f"CALLED PythonScript::_instance_has(object=<object 0x{<size_t>object:x}>)")
198198
# Check if the given object is an instance of this script
199199
# For now return False as we don't track instances yet
200200
# `gd_object_t` doesn't need to be be deleted (is it just a raw pointer)
@@ -241,7 +241,7 @@ cdef class PythonScript:
241241

242242
# godot_extension: method(virtual=True, const=True)
243243
cdef void* _placeholder_instance_create(self, gd_object_t for_object):
244-
spy_log(f"CALLED PythonScript::_placeholder_instance_create(for_object=<object>)")
244+
spy_log(f"CALLED PythonScript::_placeholder_instance_create(for_object=<object 0x{<size_t>for_object:x}>)")
245245
# Create a placeholder instance for when the script is not ready
246246
# `gd_object_t` doesn't need to be be deleted (is it just a raw pointer)
247247
return NULL

0 commit comments

Comments
 (0)