rolling

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*lumberjack.Logger
}

func NewLogger

func NewLogger(filename string, opts ...Opt) *Logger

NewLogger return rotate Logger.

type Opt

type Opt func(*Logger)

func WithCompress

func WithCompress(c bool) Opt

func WithLocaltime

func WithLocaltime(lt bool) Opt

WithLocaltime use local time.

func WithMaxAge

func WithMaxAge(a int) Opt

WithMaxAge set maximum Reserve of days, the default is not to remove old logs.

func WithMaxBackups

func WithMaxBackups(bu int) Opt

WithMaxBackups set maximum amount old log files to retain, the default is to retain all old logs.

func WithMaxSize

func WithMaxSize(s int) Opt

WithMaxSize set log maximum size in MB, defaults to 100 MB.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL