Skip to content

Conversation

jeffcharles
Copy link
Contributor

Here's one possible approach for exposing a logging API that doesn't use standard error. The logs are stored in a thread local singleton value and a function is exported from the provider to get the index into memory to get the singleton. The host provider can choose to read some or all of the buffer and render it to a UTF-8 string.

The nice thing with this approach is we can skip performing a number of checks for null pointers or performing length/capacity checks while logging outside of what the underlying vector performs.

One messy part of this approach is the need to offer an API for use by unit tests to reset the logging state.

@jeffcharles
Copy link
Contributor Author

Superseded by #99

@jeffcharles jeffcharles closed this Jul 2, 2025
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