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

Add support for the logger private buffer pool. #1253

Merged
merged 1 commit into from Apr 22, 2021
Merged

Add support for the logger private buffer pool. #1253

merged 1 commit into from Apr 22, 2021

Conversation

edoger
Copy link
Contributor

@edoger edoger commented Apr 20, 2021

Add a private buffer pool for the logger. By default, the default global buffer pool will be used.

@edoger
Copy link
Contributor Author

edoger commented Apr 20, 2021

link #1247

@dgsb dgsb self-assigned this Apr 22, 2021
Copy link
Collaborator

@dgsb dgsb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @edoger

I just have a small comment regarding the missing lock when getting the buffer pool from the logger.

@@ -260,6 +261,13 @@ func (entry *Entry) log(level Level, msg string) {
}
}

func (entry *Entry) getBufferPool() (pool BufferPool) {
if entry.Logger.BufferPool != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have that protected by the logger mutex ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only place to call this method is already protected by a mutex.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I missed that 👍

@dgsb dgsb merged commit b50299c into sirupsen:master Apr 22, 2021
@edoger edoger deleted the buffer-pool branch April 22, 2021 13:52
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.

None yet

2 participants