Skip to content

Supporting optional logging to user-provided callback. - #376

Open
sherief wants to merge 1 commit into
FNA-XNA:masterfrom
sherief:log-callback
Open

Supporting optional logging to user-provided callback.#376
sherief wants to merge 1 commit into
FNA-XNA:masterfrom
sherief:log-callback

Conversation

@sherief

@sherief sherief commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

Some users might want to redirect this, or reconcile it with logging from other subsystems in a single sink.

Some users might want to redirect this, or reconcile it with logging from
other subsystems in a single sink.
@flibitijibibo

Copy link
Copy Markdown
Member

Sadly we can't change the public structs but we can totally add something similar to FNA3D's log rerouting:

https://github.com/FNA-XNA/FNA3D/blob/master/include/FNA3D.h#L496

@sherief

sherief commented Mar 16, 2025

Copy link
Copy Markdown
Contributor Author

I see, makes sense. Would it be acceptable if I were to add a new struct / function for this?

@flibitijibibo

Copy link
Copy Markdown
Member

Definitely- we can do FAudio_HookLogFunction(s)EXT and have it be global like FNA3D, so that we don't have to fuss with object lifetime to get logs routed properly.

@sherief

sherief commented Mar 16, 2025

Copy link
Copy Markdown
Contributor Author

I host multiple instances in the same process and would prefer their output be separated - what do you think is the best path forward here?

@flibitijibibo

Copy link
Copy Markdown
Member

If you've got an active test case then we can accommodate that - usually I just shotgun blast debug stuff unless somebody has a specific need, so if we need to put a function pointer in the FAudio object that's fine too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants