mirror of https://github.com/LIJI32/SameBoy.git
Updated GB_set_log_callback (markdown)
parent
b18a4716d9
commit
6b8fab9fd9
|
@ -1,17 +1,21 @@
|
|||
## Definition
|
||||
|
||||
```c
|
||||
typedef void (*GB_log_callback_t)(GB_gameboy_t *gb, const char *string, GB_log_attributes_t attributes);
|
||||
```
|
||||
<tt>typedef void (*GB_log_callback_t)([[GB_gameboy_t]] *gb, const char *string, [[GB_log_attributes_t]] attributes);</tt>
|
||||
|
||||
<tt>void GB_set_log_callback([[GB_gameboy_t]] *gb, [[GB_log_callback_t]] callback);</tt>
|
||||
<tt>void GB_set_log_callback([[GB_gameboy_t]] *gb, GB_log_callback_t callback);</tt>
|
||||
|
||||
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]]
|
Loading…
Reference in New Issue