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

Race condition when accessing loggers #43

Closed
dignifiedquire opened this issue Aug 15, 2018 · 4 comments
Closed

Race condition when accessing loggers #43

dignifiedquire opened this issue Aug 15, 2018 · 4 comments

Comments

@dignifiedquire
Copy link
Member

The global variable in oldlog.go creates race issues when trying to call Logger("name") from two different threads.

@Stebalien
Copy link
Member

This is usually to be called during initialization. That is:

var log = logging.Logger("my-module-name")

However, it shouldn't cost anything to make it thread-safe.

@Stebalien
Copy link
Member

Yeah, we'll want this anyways for pluggins.

@Stebalien
Copy link
Member

However, you should still avoid doing this outside of init.

@Stebalien
Copy link
Member

Fixed in #44.

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