Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DailyRotator ¶
DailyRotator is writer which rotates file by date
func NewDailyRotator ¶
func NewDailyRotator(path string) *DailyRotator
NewDailyRotator creates rotator which writes to the file
func (*DailyRotator) Write ¶
func (r *DailyRotator) Write(bytes []byte) (n int, err error)
Write binaries to the file. It will rotate files if date is chnaged from last writing.
func (*DailyRotator) WriteString ¶
func (r *DailyRotator) WriteString(str string) (n int, err error)
WriteString writes strings to the file. It will rotate files if date is chnaged from last writing.
type Rotator ¶
type Rotator interface { // a Write method, a Close method io.WriteCloser // WriteString writes strings to the file. WriteString(str string) (n int, err error) }
Rotator interface
type SizeRotator ¶
type SizeRotator struct { RotationSize int64 // size threshold of the rotation MaxRotation int // maximum count of the rotation // contains filtered or unexported fields }
SizeRotator is file writer which rotates files by size
func NewSizeRotator ¶
func NewSizeRotator(path string) *SizeRotator
NewSizeRotator creates new writer of the file
func (*SizeRotator) Write ¶
func (r *SizeRotator) Write(bytes []byte) (n int, err error)
Write bytes to the file. If binaries exceeds rotation threshold, it will automatically rotate the file.
func (*SizeRotator) WriteString ¶
func (r *SizeRotator) WriteString(str string) (n int, err error)
WriteString writes strings to the file. If binaries exceeds rotation threshold, it will automatically rotate the file.