logging

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MPL-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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