logrotate

package module
v0.0.0-...-5a04431 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: BSD-3-Clause Imports: 6 Imported by: 2

README

logrotate

Build Status Coverage Status Go Report Card

go package for creating and rotating log files

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logrotate

type Logrotate struct {
	sync.Mutex
	Age       time.Duration
	Num       int
	Size      int
	Timestamp bool
	// contains filtered or unexported fields
}

Logrotate struct

func New

func New(logfile string, age, num, size int, timestamp bool) (*Logrotate, error)

New return instance of Logrotate defaults age 86400 rotate every 24h0m0s num 7 files size 0 no limit size timestamp false

func (*Logrotate) Close

func (l *Logrotate) Close() error

Close implements io.Closer, and closes the current logfile

func (*Logrotate) Rotate

func (l *Logrotate) Rotate() error

Rotate helper function for rotate

func (*Logrotate) Write

func (l *Logrotate) Write(p []byte) (n int, err error)

Write implements io.Writer

Jump to

Keyboard shortcuts

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