Supporting optional logging to user-provided callback. #376

Open
sherief wants to merge 1 commit from sherief/log-callback into master
sherief commented 2025-03-16 13:29:50 -05:00 (Migrated from github.com)

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 commented 2025-03-16 14:02:23 -05:00 (Migrated from github.com)

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

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 commented 2025-03-16 14:21:54 -05:00 (Migrated from github.com)

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

I see, makes sense. Would it be acceptable if I were to add a new struct / function for this?
flibitijibibo commented 2025-03-16 14:29:01 -05:00 (Migrated from github.com)

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.

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 commented 2025-03-16 14:37:56 -05:00 (Migrated from github.com)

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?

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 commented 2025-03-16 20:35:56 -05:00 (Migrated from github.com)

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.

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.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'sherief/log-callback:sherief/log-callback'
git switch 'sherief/log-callback'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'master'
git merge --no-ff 'sherief/log-callback'
git switch 'sherief/log-callback'
git rebase 'master'
git switch 'master'
git merge --ff-only 'sherief/log-callback'
git switch 'sherief/log-callback'
git rebase 'master'
git switch 'master'
git merge --no-ff 'sherief/log-callback'
git switch 'master'
git merge --squash 'sherief/log-callback'
git switch 'master'
git merge --ff-only 'sherief/log-callback'
git switch 'master'
git merge 'sherief/log-callback'
git push origin 'master'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-FNA-XNA/FAudio!376
No description provided.