From 6b8fab9fd93f014c5af9be34e65878b4e5af5b63 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 30 Nov 2024 18:22:11 +0200 Subject: [PATCH] Updated GB_set_log_callback (markdown) --- GB_set_log_callback.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/GB_set_log_callback.md b/GB_set_log_callback.md index d0b1c00..31edfae 100644 --- a/GB_set_log_callback.md +++ b/GB_set_log_callback.md @@ -1,17 +1,21 @@ ## Definition -```c -typedef void (*GB_log_callback_t)(GB_gameboy_t *gb, const char *string, GB_log_attributes_t attributes); -``` +typedef void (*GB_log_callback_t)([[GB_gameboy_t]] *gb, const char *string, [[GB_log_attributes_t]] attributes); -void GB_set_log_callback([[GB_gameboy_t]] *gb, [[GB_log_callback_t]] callback); +void GB_set_log_callback([[GB_gameboy_t]] *gb, GB_log_callback_t callback); In `gb.h` ## Description -TBD +Sets a callback that will be called whenever the emulator instance wants to output information such as errors, warnings and debugger output. Logs are formatted, and each `string` is accompanied with a bitfield of [[attributes|GB_log_attributes_t]] determining its visual style. Do not implicitly add new lines (`'\n'`) after `string`, `string` will include a `'\n'` suffix if and only if it's required. ## Thread Safety If `callback` is not NULL, `GB_set_log_callback` is thread-safe and can be called from any thread and context. Otherwise, it must not be called if the instance is being run in another thread, but may be called from the current one (via a callback). + +## See Also + +* [[GB_log_attributes_t]] +* [[GB_log]] +* [[GB_attributed_log]] \ No newline at end of file