Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoggerOption ¶
type LoggerOption interface {
// contains filtered or unexported methods
}
A LoggerOption sets options such as filename, etc.
func WithFileName ¶
func WithFileName(fn string) LoggerOption
WithFileName returns a LoggerOption that sets filename for logger. Note: Default it uses /tmp/zap-logger.log.
func WithMaxAge ¶
func WithMaxAge(maxAge int) LoggerOption
WithMaxAge returns a LoggerOption that sets maxAge for logger. MaxAge is the maximum number of days to retain old log files based on the timestamp encoded in their filename. Note: Default it uses 7 days.
func WithMaxBackups ¶
func WithMaxBackups(maxBackups int) LoggerOption
WithMaxBackups returns a LoggerOption that sets maxBackups for logger. MaxBackups is the maximum number of old log files to retain. Note: Default it uses 3 .
func WithMaxSize ¶
func WithMaxSize(maxSize int) LoggerOption
WithMaxSize returns a LoggerOption that sets maxSize for logger. MaxSize is the maximum size in megabytes of the log file before it gets rotated. Note: Default it uses 500 megabytes.