Documentation ¶
Index ¶
Constants ¶
View Source
const (
CompressSuffix = ".gz"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*Options)
Option modifies the Options.
func WithCompress ¶
WithCompress returns an Option which sets whether log files should be compressed.
func WithMaxAge ¶
WithMaxAge returns an Option which sets the max expire time(Day) of log files.
func WithMaxBackups ¶
WithMaxBackups returns an Option which sets the max number of backup log files.
func WithMaxSize ¶
WithMaxSize returns an Option which sets the max size(MB) of log files.
func WithRotationTime ¶
WithRotationTime returns an Option which sets the time format(%Y%m%d) to roll logs.
type Options ¶
type Options struct { // MaxSize is max size by byte of the log file. MaxSize int64 // MaxBackups is the max number of log files. MaxBackups int // MaxAge is the max expire time by day of log files. MaxAge int // whether the log file should be compressed. Compress bool // TimeFormat is the time format to split log file by time. TimeFormat string }
Options is the rollWriter call options.
Click to show internal directories.
Click to hide internal directories.