logger

package
v0.0.0-...-b480da5 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger *logrus.Logger
)

Functions

func GetLogWriter

func GetLogWriter(logPath string, logType string, maxAge time.Duration, rotateTime time.Duration) io.Writer

func GetRequestLogger

func GetRequestLogger(requestId string) *logrus.Entry

func Init

func Init()

Types

type Formatter

type Formatter struct {
	// Timestamp format
	TimestampFormat string
	// Available standard keys: time, msg, lvl
	// Also can include custom fields but limited to strings.
	// All of fields need to be wrapped inside %% i.e %time% %msg%
	LogFormat string
}

Formatter implements logrus.Formatter interface.

func (*Formatter) Format

func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error)

Format building log message.

Jump to

Keyboard shortcuts

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