Add support for the logger private buffer pool.

This commit is contained in:
Qingshan Luo
2021-04-20 10:48:30 +08:00
parent fdf1618bf7
commit 1818363d79
4 changed files with 49 additions and 12 deletions
-9
View File
@@ -26,15 +26,6 @@ func (p *defaultPool) Get() *bytes.Buffer {
return p.pool.Get().(*bytes.Buffer)
}
func getBuffer() *bytes.Buffer {
return bufferPool.Get()
}
func putBuffer(buf *bytes.Buffer) {
buf.Reset()
bufferPool.Put(buf)
}
// SetBufferPool allows to replace the default logrus buffer pool
// to better meets the specific needs of an application.
func SetBufferPool(bp BufferPool) {