log

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: GPL-3.0 Imports: 16 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 (
	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) CompressFile

func (w *Writer) CompressFile(logFile string) error

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