Skip to content

Logging API #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Logging API #93

wants to merge 1 commit into from

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.

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