logrus

package
v0.0.0-...-3cba33c Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: MIT Imports: 4 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// TextFormatter is a text formatter name for logrus logger.
	TextFormatter = "text"

	// JSONFormatter is a JSON formatter name for logrus logger.
	JSONFormatter = "json"
)

Variables

This section is empty.

Functions

func New

func New(l *logrus.Logger) loggers.Logger

New wraps logrus logger with binding.

func NewErrUnknownFormatter

func NewErrUnknownFormatter(f string) error

func NewFromConfig

func NewFromConfig(c Config) (loggers.Logger, error)

New creates and wraps new logrus logger with binding.

Types

type Config

type Config struct {
	Level     string `validate:"required" default:"info"`
	Formatter string `validate:"required" default:"json"`
}

Config is a logrus configuration which could be customized.

type ErrUnknownFormatter

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

func (*ErrUnknownFormatter) Error

func (e *ErrUnknownFormatter) Error() string

type Logrus

type Logrus struct {
	*logrus.Logger
}

Logrus is a logrus for logger that implements io.Writer interface.

func (*Logrus) Level

func (l *Logrus) Level() interface{}

Level returns a current logger level number.

func (*Logrus) Write

func (l *Logrus) Write(buf []byte) (int, error)

Write slice of bytes into the logger and return number of written bytes and error value of present.

Jump to

Keyboard shortcuts

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