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

rotatingfilewriter

package
v3.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorPrintf func(format string, args ...any)

Functions

This section is empty.

Types

type Options

type Options struct {
	Rotate           bool
	MaximumSize      int64
	RotateDaily      bool
	KeepDays         int
	Compress         bool
	CompressionLevel int
}

type RotatingFileWriter

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

func Open

func Open(filename string, options *Options) (*RotatingFileWriter, error)

Open creates a new rotating file writer. Notice: if a file is opened by two rotators, there will be conflicts when rotating. In the future, there should be "rotating file manager"

func (*RotatingFileWriter) Close

func (rfw *RotatingFileWriter) Close() error

func (*RotatingFileWriter) DoRotate

func (rfw *RotatingFileWriter) DoRotate() error

DoRotate the log file creating a backup like xx.2013-01-01.2

func (*RotatingFileWriter) Flush

func (rfw *RotatingFileWriter) Flush() error

func (*RotatingFileWriter) ReleaseReopen

func (rfw *RotatingFileWriter) ReleaseReopen() error

func (*RotatingFileWriter) Write

func (rfw *RotatingFileWriter) Write(b []byte) (int, error)

Source Files

  • writer.go

Jump to

Keyboard shortcuts

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