rotatingfilewriter

package
v1.24.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 11 Imported by: ? 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

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)

Jump to

Keyboard shortcuts

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