Skip to content
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

Allow building a Logger yourself #53

Merged
merged 4 commits into from
Jan 16, 2018
Merged

Allow building a Logger yourself #53

merged 4 commits into from
Jan 16, 2018

Conversation

KodrAus
Copy link
Collaborator

@KodrAus KodrAus commented Jan 14, 2018

Previously, I removed the ability to build and get a hold of a Logger type, because it relies on thread-local state that was configured using the style options of the first Logger to write a record.

This PR fixes up that situation so multiple Loggers can log on the same thread using the styles they were originally configured with. Each time we access the thread-local buffer we check to see if its configuration matches the current Logger. If it doesn't then we drop it and create a new one.

@KodrAus
Copy link
Collaborator Author

KodrAus commented Jan 14, 2018

I've also added an example of using a Logger to write records directly, without using the log macros. It also works as a smoke test for the changes in this PR.

@KodrAus KodrAus merged commit f7abf9c into master Jan 16, 2018
@KodrAus KodrAus deleted the feat/build-logger branch January 17, 2018 21:18
@KodrAus KodrAus restored the feat/build-logger branch January 17, 2018 21:18
@KodrAus KodrAus deleted the feat/build-logger branch January 17, 2018 21:19
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.

1 participant