writer

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

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

CLI is a concurrent output writer to terminal.

func NewCLI

func NewCLI() *CLI

NewCLI returns a new CLI concurrent log writer.

func (*CLI) Write

func (w *CLI) Write(data []byte, level levels.Level)

WriteString writes an output to the underlying file

type FileWithRotation added in v1.1.5

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

FileWithRotation is a concurrent output writer to a file with rotation.

func NewFileWithRotation added in v1.1.5

func NewFileWithRotation(options *FileWithRotationOptions) (*FileWithRotation, error)

NewFileWithRotation returns a new file concurrent log writer.

func (*FileWithRotation) Close added in v1.1.5

func (w *FileWithRotation) Close()

Close and flushes the logger

func (*FileWithRotation) CreateFile added in v1.1.5

func (w *FileWithRotation) CreateFile(filename string) (*os.File, error)

func (*FileWithRotation) Write added in v1.1.5

func (w *FileWithRotation) Write(data []byte, level levels.Level)

Write writes an output to the underlying file

type FileWithRotationOptions added in v1.1.5

type FileWithRotationOptions struct {
	Location string
	Rotate   bool

	RotationInterval time.Duration
	FileName         string
	Compress         bool
	MaxSize          int
	BackupTimeFormat string
	ArchiveFormat    string
	// Helpers
	RotateEachHour bool
	RotateEachDay  bool
	// contains filtered or unexported fields
}
var DefaultFileWithRotationOptions FileWithRotationOptions

type Writer

type Writer interface {
	// Write writes the data to an output writer.
	Write(data []byte, level levels.Level)
}

Writer type writes data to an output type.

Jump to

Keyboard shortcuts

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