log

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OutputStdout     bool          `configkey:"log.output_stdout"`
	RotationCount    int           `configkey:"log.rotation_counts" validate:"required_without=OutputStdout"`
	RotationInterval time.Duration `configkey:"log.rotation_interval,duration" validate:"required_without=OutputStdout"`
	LogDir           string        `configkey:"log.dir" validate:"required_without=OutputStdout"`
	LogFileBaseName  string        `configkey:"log.basename" validate:"required_without=OutputStdout"`
	LogFormat        string        `configkey:"log.format" validate:"eq=json|eq=text"`
	LogLevel         string        `configkey:"log.level" validate:"required"`
}

Config contains the configuration parameters for the log.

type Log

type Log struct {
	Logger *logrus.Logger
	// contains filtered or unexported fields
}

Log is used by the application to log information.

func NewLog

func NewLog(config *Config) *Log

NewLog creates a new log structure.

func (*Log) Finalize

func (l *Log) Finalize() error

Finalize cleans up the resources of the log instance.

func (*Log) Initialize

func (l *Log) Initialize() error

Initialize sets up a log instance.

func (*Log) IsInitialized

func (l *Log) IsInitialized() bool

IsInitialized returns whether the log instance is initialized.

func (*Log) NewEntry

func (l *Log) NewEntry() *logrus.Entry

NewEntry creates a new entry.

Jump to

Keyboard shortcuts

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