Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v1.108.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultMaxSize    = 10 * 1024 * 1024 // 10MB
	DefaultMaxBackups = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*RotatingFile)

func WithMaxBackups

func WithMaxBackups(count int) Option

func WithMaxSize

func WithMaxSize(size int64) Option

type RotatingFile

type RotatingFile struct {
	// contains filtered or unexported fields
}

RotatingFile is an io.WriteCloser that rotates log files when they exceed a size limit.

func NewRotatingFile

func NewRotatingFile(path string, opts ...Option) (*RotatingFile, error)

NewRotatingFile creates a new rotating file writer.

func (*RotatingFile) Close

func (r *RotatingFile) Close() error

func (*RotatingFile) Write

func (r *RotatingFile) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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