Documentation ¶
Overview ¶
Package rotatewriter contains additional tool for logging packages - RotateWriter Writer which implement normal fast smooth rotation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RotateWriter ¶
type RotateWriter struct { Filename string NumFiles int IsBuffered bool FlushTimeout time.Duration BufferSize int // contains filtered or unexported fields }
RotateWriter is Writer with Rotate function to make correctly rotation of
func NewRotateBufferedWriter ¶
func NewRotateBufferedWriter(fileName string, numfiles int, flushTimeout time.Duration, bufferSize int) (rw *RotateWriter, err error)
NewRotateBufferedWriter creates new buffered instance make some checks there fileName: filename, must contain existing directory file numfiles: 0 if no rotation at all - just reopen file on rotation. e.g. you would like use logrotate numfiles: >0 if rotation enabled flush timeout - flush after timeout when there are no writes buffer size to work with
func NewRotateWriter ¶
func NewRotateWriter(fileName string, numfiles int) (rw *RotateWriter, err error)
NewRotateWriter creates new instance make some checks there fileName: filename, must contain existing directory file numfiles: 0 if no rotation at all - just reopen file on rotation. e.g. you would like use logrotate numfiles: >0 if rotation enabled
func (*RotateWriter) CloseWriteFile ¶
func (rw *RotateWriter) CloseWriteFile() error
CloseWriteFile use to close writer if you need
func (*RotateWriter) Rotate ¶
func (rw *RotateWriter) Rotate(ready func()) error
Rotate rotates file
func (*RotateWriter) RotationInProgress ¶
func (rw *RotateWriter) RotationInProgress() bool
RotationInProgress detects rotation is running now