logging

package
v0.0.5-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(lvl logrus.Level, path, initialContext string, mode LogMode) (*logrus.Entry, func() error, error)

Types

type LogMode

type LogMode byte
const (
	ModeDiscard LogMode = 1 << iota
	ModeConsole
	ModeFile
)

type Rotator

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

Rotator represents a struct responsible for writing into a log file while rotating the file when it reached maxSize.

func (*Rotator) Close

func (r *Rotator) Close() error

Close closes the io.Writer of the Rotator.

func (*Rotator) Write

func (r *Rotator) Write(data []byte) (int, error)

Write writes the data into the log file and initiates rotation, if necessary

type TbsFormatter

type TbsFormatter struct {
	TimestampFormat string
	LogFormat       string
	LevelPadding    uint8
	ContextPadding  uint8
}

func (*TbsFormatter) Format

func (f *TbsFormatter) Format(e *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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