Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
55 lines
3.0 KiB
XML
55 lines
3.0 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="Logger" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
|
<brief_description>
|
|
Custom logger to receive messages from the internal error/warning stream.
|
|
</brief_description>
|
|
<description>
|
|
Custom logger to receive messages from the internal error/warning stream. Loggers are registered via [method OS.add_logger].
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="_log_error" qualifiers="virtual">
|
|
<return type="void" />
|
|
<param index="0" name="function" type="String" />
|
|
<param index="1" name="file" type="String" />
|
|
<param index="2" name="line" type="int" />
|
|
<param index="3" name="code" type="String" />
|
|
<param index="4" name="rationale" type="String" />
|
|
<param index="5" name="editor_notify" type="bool" />
|
|
<param index="6" name="error_type" type="int" />
|
|
<param index="7" name="script_backtraces" type="ScriptBacktrace[]" />
|
|
<description>
|
|
Called when an error is logged. The error provides the [param function], [param file], and [param line] that it originated from, as well as either the [param code] that generated the error or a [param rationale].
|
|
The type of error provided by [param error_type] is described in the [enum ErrorType] enumeration.
|
|
Additionally, [param 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 [member ProjectSettings.debug/settings/gdscript/always_track_call_stacks].
|
|
[b]Warning:[/b] This function may be called from multiple different threads, so you may need to do your own locking.
|
|
[b]Note:[/b] [param 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 [method Engine.capture_script_backtraces].
|
|
</description>
|
|
</method>
|
|
<method name="_log_message" qualifiers="virtual">
|
|
<return type="void" />
|
|
<param index="0" name="message" type="String" />
|
|
<param index="1" name="error" type="bool" />
|
|
<description>
|
|
Called when a message is logged. If [param error] is [code]true[/code], then this message was meant to be sent to [code]stderr[/code].
|
|
[b]Warning:[/b] This function may be called from multiple different threads, so you may need to do your own locking.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<constants>
|
|
<constant name="ERROR_TYPE_ERROR" value="0" enum="ErrorType">
|
|
The message received is an error.
|
|
</constant>
|
|
<constant name="ERROR_TYPE_WARNING" value="1" enum="ErrorType">
|
|
The message received is a warning.
|
|
</constant>
|
|
<constant name="ERROR_TYPE_SCRIPT" value="2" enum="ErrorType">
|
|
The message received is a script error.
|
|
</constant>
|
|
<constant name="ERROR_TYPE_SHADER" value="3" enum="ErrorType">
|
|
The message received is a shader error.
|
|
</constant>
|
|
</constants>
|
|
</class>
|