Skip to content

GB_set_log_callback

Lior Halphon edited this page Nov 30, 2024 · 3 revisions

Definition

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);

In gb.h

Description

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 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

Clone this wiki locally