Skip to content

Commit b9ca083

Browse files
committed
Mention importance of thread-safety in Logger example
1 parent e958d86 commit b9ca083

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tutorials/scripting/logging.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ Here is a minimal working example of a custom logger, with the script added as a
225225
func _log_message(message: String, error: bool) -> void:
226226
# Do something with `message`.
227227
# `error` is `true` for messages printed to the standard error stream (stderr) with `print_error()`.
228+
# Note that this method will be called from threads other than the main thread, possibly at the same
229+
# time, so you will need to have some kind of thread-safety as part of it, like a Mutex.
228230
pass
229231
230232
func _log_error(
@@ -239,6 +241,8 @@ Here is a minimal working example of a custom logger, with the script added as a
239241
) -> void:
240242
# Do something with the error. The error text is in `rationale`.
241243
# See the Logger class reference for details on other parameters.
244+
# Note that this method will be called from threads other than the main thread, possibly at the same
245+
# time, so you will need to have some kind of thread-safety as part of it, like a Mutex.
242246
pass
243247
244248
# Use `_init()` to initialize the logger as early as possible, which ensures that messages

0 commit comments

Comments
 (0)