Documentation ¶
Overview ¶
Package asynczap implements asynchronous core for zap.
By default, zap writes every log line synchronously and without buffering. This behaviour is completely inadequate for high-rate logging.
This implementation of zap.Core moves file write to background goroutine, while carefully monitoring memory consumption.
When background goroutine can't keep up with logging rate, log records are dropped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct { zapcore.LevelEnabler // contains filtered or unexported fields }
func NewCore ¶
func NewCore(enc zapcore.Encoder, ws zapcore.WriteSyncer, enab zapcore.LevelEnabler, options Options) *Core
NewCore creates a Core that writes logs to a WriteSyncer.
func (*Core) Check ¶
func (c *Core) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
type Options ¶
type Options struct { // MaxMemoryUsage is maximum amount of memory that will be used by in-flight log records. MaxMemoryUsage int // WriteBufferSize specifies size of the buffer used for writes to underlying file. WriteBufferSize int // FlushInterval specifies how often background goroutine would wake up. FlushInterval time.Duration }
Click to show internal directories.
Click to hide internal directories.