Skip to content

Commit fe4cc92

Browse files
committed
Merge pull request godotengine#109174 from mihe/logger-docs-note
Add documentation about logging from `Logger` not being supported
2 parents 06bdfa5 + 3868e7e commit fe4cc92

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/classes/Logger.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
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].
2626
[b]Warning:[/b] This method will be called from threads other than the main thread, possibly at the same time, so you will need to have some kind of thread-safety in your implementation of it, like a [Mutex].
2727
[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].
28+
[b]Note:[/b] Logging errors from this method using functions like [method @GlobalScope.push_error] or [method @GlobalScope.push_warning] is not supported, as it could cause infinite recursion. These errors will only show up in the console output.
2829
</description>
2930
</method>
3031
<method name="_log_message" qualifiers="virtual">
@@ -34,6 +35,7 @@
3435
<description>
3536
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].
3637
[b]Warning:[/b] This method will be called from threads other than the main thread, possibly at the same time, so you will need to have some kind of thread-safety in your implementation of it, like a [Mutex].
38+
[b]Note:[/b] Logging another message from this method using functions like [method @GlobalScope.print] is not supported, as it could cause infinite recursion. These messages will only show up in the console output.
3739
</description>
3840
</method>
3941
</methods>

0 commit comments

Comments
 (0)