Skip to main content

print_custom

Function print_custom 

pub fn print_custom(record: PrintRecord<'_>)
Expand description

Low-level printing of log messages with full control over level, source location and editor toast.

Most users should prefer the godot_print!, godot_warn! and godot_error! macros. print_custom() is intended for low-level configurability or integration with crates like tracing or log.

See PrintRecord and PrintLevel for routing and source-location behavior. Due to the use of C-strings, if any of the string fields in PrintRecord or PrintSource have a nul byte (\0) in the middle, the printed text will be cut off at that nul byte. Consider this when working with user-provided texts (e.g. for logging).

ยงThread safety

Safe to call from any thread on standard desktop builds; output from concurrent threads may interleave between lines, which is cosmetic. See the thread-safety note at the print macros (this module) for the per-backend C++ rationale and the one caveat (custom non-locking FileAccess log backends).