log

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLogger = NewLogger()
)

Functions

func Extract

func Extract(ctx echo.Context) *logrus.Entry

func WithLogger

func WithLogger(ctx echo.Context, logger *logrus.Entry) echo.Context

Types

type Logger

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

Logger wraps logrus.Logger

func NewLogger

func NewLogger() *Logger

NewLogger returns a Logger instance

func (*Logger) Debugj

func (l *Logger) Debugj(j log.JSON)

Debugj is used to implement echo.Logger. It creates an logrus.Entry with fields j, then call Debug.

func (*Logger) Errorj

func (l *Logger) Errorj(j log.JSON)

Errorj is used to implement echo.Logger. It creates an logrus.Entry with fields j, then call Error.

func (*Logger) Fatalj

func (l *Logger) Fatalj(j log.JSON)

Fatalj is used to implement echo.Logger. It creates an logrus.Entry with fields j, then call Fatal.

func (*Logger) Infoj

func (l *Logger) Infoj(j log.JSON)

Infoj is used to implement echo.Logger. It creates an logrus.Entry with fields j, then call Info.

func (*Logger) Level

func (l *Logger) Level() log.Lvl

Level returns current logging level.

func (*Logger) Output

func (l *Logger) Output() io.Writer

Output returns Logger's output destination.

func (*Logger) Panicj

func (l *Logger) Panicj(j log.JSON)

Panicj is used to implement echo.Logger. It creates an logrus.Entry with fields j, then call Panic.

func (*Logger) Prefix

func (l *Logger) Prefix() string

Prefix is used to implement echo.Logger. This function always returns empty string because prefix is not needed in logrus.

func (*Logger) Printj

func (l *Logger) Printj(j log.JSON)

Printj is used to implement echo.Logger. It creates an logrus.Entry with fields j, then call Print.

func (*Logger) SetFormatter

func (l *Logger) SetFormatter(formatter logrus.Formatter)

SetFormatter changes logger's formatter

func (*Logger) SetHeader added in v1.0.2

func (l *Logger) SetHeader(h string)

func (*Logger) SetLevel

func (l *Logger) SetLevel(v log.Lvl)

SetLevel changes logging level. If you want to change underlying logrus logger's level, call l.Logger.SetLevel function.

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput changes logger's output destination

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(p string)

SetPrefix is used to implement echo.Logger. Do nothing here.

func (*Logger) Warnj

func (l *Logger) Warnj(j log.JSON)

Warnj is used to implement echo.Logger. It creates an logrus.Entry with fields j, then call Warn.

Jump to

Keyboard shortcuts

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