rotatingfilewriter

package
v1.23.0-dev Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 11 Imported by: 1

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