mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-14 07:34:43 +08:00
新增异步日志功能
This commit is contained in:
@@ -2,27 +2,20 @@ package log // import "go.uber.org/zap/buffer"
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const _size = 9216
|
||||
|
||||
type Buffer struct {
|
||||
bs []byte
|
||||
mu sync.Mutex // ensures atomic writes; protects the following fields
|
||||
//mu sync.Mutex // ensures atomic writes; protects the following fields
|
||||
}
|
||||
|
||||
func (buff *Buffer) Init(){
|
||||
buff.bs = make([]byte,_size)
|
||||
}
|
||||
|
||||
func (buff *Buffer) Locker() {
|
||||
buff.mu.Lock()
|
||||
}
|
||||
|
||||
func (buff *Buffer) UnLocker() {
|
||||
buff.mu.Unlock()
|
||||
}
|
||||
|
||||
// AppendByte writes a single byte to the Buffer.
|
||||
func (b *Buffer) AppendByte(v byte) {
|
||||
|
||||
Reference in New Issue
Block a user