rollingwriter

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RollingWriter

type RollingWriter struct {
	Writer io.Writer
	// contains filtered or unexported fields
}

RollingWriter represents logs writer with logs rolling and cleanup support.

func NewRollingWriter

func NewRollingWriter(filepath string) (writer *RollingWriter, err error)

NewRollingWriter creates new rolling writer.

func (*RollingWriter) CleanObsoleteLogs

func (w *RollingWriter) CleanObsoleteLogs() error

CleanObsoleteLogs cleans obsolete logs so that the count of remaining log files is equal to w.config.MaxRemain. rollingWriter only handles file rolling at runtime, but if the node is restarted, the count is lost thus we have to do this manually.

func (*RollingWriter) Write

func (w *RollingWriter) Write(b []byte) (int, error)

Write writes to underlying rolling writer.

Jump to

Keyboard shortcuts

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