log

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BufferSize         = 0x100000
	DefaultFileMode    = os.FileMode(0644)
	DefaultFileFlag    = os.O_RDWR | os.O_CREATE | os.O_APPEND
	ErrInvalidArgument = errors.New("error argument invalid")
	QueueSize          = 1024
	ErrClosed          = errors.New("error write on close")
)

Functions

func FilePath

func FilePath(c *Config) (filepath string)

Types

type AsynchronousWriter

type AsynchronousWriter struct {
	Writer
	// contains filtered or unexported fields
}

func (*AsynchronousWriter) Close

func (w *AsynchronousWriter) Close() error

type Config

type Config struct {
	TimeTagFormat      string
	LogPath            string
	FileName           string
	LogSuffix          string
	MaxRemain          int
	RollingTimePattern string
}

type Manager

type Manager interface {
	Fire() chan string
	Close()
}

func NewManager

func NewManager(c *Config) (Manager, error)

type RollingWriter

type RollingWriter interface {
	io.Writer
	Close() error
}

func NewWriterFromConfig

func NewWriterFromConfig(c *Config) (RollingWriter, error)

type Writer

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

func (*Writer) DoRemove

func (w *Writer) DoRemove()

func (*Writer) Reopen

func (w *Writer) Reopen(file string) error

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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