Documentation
¶
Overview ¶
Custom logger to receive messages from the internal error/warning stream. Loggers are registered via OS.AddLogger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
type Interface ¶
type Interface interface { // Called when an error is logged. The error provides the 'function', 'file', and 'line' that it originated from, as well as either the 'code' that generated the error or a 'rationale'. // // The type of error provided by 'error_type' is described in the [ErrorType] enumeration. // // Additionally, 'script_backtraces' provides backtraces for each of the script languages. These will only contain stack frames in editor builds and debug builds by default. To enable them for release builds as well, you need to enable [ProjectSettings] "debug/settings/gdscript/always_track_call_stacks". // // Warning: This function may be called from multiple different threads, so you may need to do your own locking. // // Note: 'script_backtraces' will not contain any captured variables, due to its prohibitively high cost. To get those you will need to capture the backtraces yourself, from within the [Logger] virtual methods, using [Engine.CaptureScriptBacktraces]. // // [Engine.CaptureScriptBacktraces]: https://pkg.go.dev/graphics.gd/classdb/Engine#CaptureScriptBacktraces // [Logger]: https://pkg.go.dev/graphics.gd/classdb/Logger // [ProjectSettings]: https://pkg.go.dev/graphics.gd/classdb/ProjectSettings LogError(function string, file string, line int, code string, rationale string, editor_notify bool, error_type int, script_backtraces []ScriptBacktrace.Instance) // Called when a message is logged. If 'error' is true, then this message was meant to be sent to stderr. // // Warning: This function may be called from multiple different threads, so you may need to do your own locking. LogMessage(message string, error bool) }