logging

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileRotator

type FileRotator struct {
	MaxFiles int   // MaxFiles is the maximum number of rotated files allowed in a path
	FileSize int64 // FileSize is the size a rotated file is allowed to grow
	// contains filtered or unexported fields
}

FileRotator writes bytes to a rotated set of files

func NewFileRotator

func NewFileRotator(path string, baseFile string, maxFiles int,
	fileSize int64, logger hclog.Logger) (*FileRotator, error)

NewFileRotator returns a new file rotator

func (*FileRotator) Close

func (f *FileRotator) Close() error

Close flushes and closes the rotator. It never returns an error.

func (*FileRotator) Write

func (f *FileRotator) Write(p []byte) (n int, err error)

Write writes a byte array to a file and rotates the file if it's size becomes equal to the maximum size the user has defined.

Jump to

Keyboard shortcuts

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