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

Thread local loggers #10

Closed
arthurprs opened this issue Jun 25, 2016 · 3 comments
Closed

Thread local loggers #10

arthurprs opened this issue Jun 25, 2016 · 3 comments

Comments

@arthurprs
Copy link

arthurprs commented Jun 25, 2016

I was wondering if we could have some sort of thread local logger (possibly adaptors for coroutine local as well), this way you wouldn't have to pass the logger around in most cases, making the crate much more ergonomic.

It wouldn't work for all occasions, granted, but I can see it being very useful in a lot of cases.

@dpc
Copy link
Collaborator

dpc commented Jun 26, 2016

Hmm...

So loggers can be used as immutable, are Sync+Send, so I believe they could be put into a global, and have a closure that prints some values from thread-local variables.

One could also store them in thread-local itself, pass to a spawned thread and save there, I believe.

I haven't really though about it yet and I'm open for feedback and ideas.

@dpc
Copy link
Collaborator

dpc commented Jun 26, 2016

I have published examples of thread-local handling. (with some comments in the header). I'm still open for discussion on improvements.

@dpc
Copy link
Collaborator

dpc commented Jul 9, 2016

Closing for now. No immediate action that I see.

@dpc dpc closed this as completed Jul 9, 2016
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

No branches or pull requests

2 participants