rotatingfilewriter

package
v0.0.0-...-495e01f Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 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)

Jump to

Keyboard shortcuts

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