Log API #624
-
I am updating from an earlier version and I see the logging has changed to a much more complicated system. The code file says to look at the log API to see how to configure the new logging option but I can't find that so could someone tell me where to look please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's not complicated. Just register your callback against a ma_log_register_callback(ma_device_get_log(pDevice), ma_log_callback_init(ma_log_callback, NULL)); If you want to manage your own log object, just pass it into the context config: ma_log log;
ma_log_init(NULL, &log);
ma_log_register_callback(&log, ma_log_callback_init(my_log, NULL));
// ... initialize your context config ...
contextConfig.pLog = &log; Make sure you keep the log object alive for the life of the context. Moving this to the discussion section. |
Beta Was this translation helpful? Give feedback.
It's not complicated. Just register your callback against a
ma_log
object. You can retrieve the log of a device withma_device_get_log()
.If you want to manage your own log object, just pass it into the context config:
Make sure you keep the log object alive for the life of the context.
Moving this to the discussion section.