Documentation

Overview

Package logger is responsible for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *Config) *logrus.Entry

New creates new instance of logging apparatus. Logrus.Entry is returned as it's always decorated with fields.

Types

type Config

type Config struct {
	// Level sets the minimal logging level
	// values: debug, info (default), warn, warning, error, fatal, panic
	Level LogLevel `envconfig:"default=info"`
}

Config is responsible for configuring logger.

type Formatter

type Formatter struct{}

Formatter is a log formatter

func (*Formatter) Format

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

Format formats log entry

type LogLevel

type LogLevel logrus.Level

LogLevel is a config field type holding minimal log level. It's compatible with logrus level types.

func (*LogLevel) Unmarshal

func (m *LogLevel) Unmarshal(in string) error

Unmarshal provides custom parsing of Log Level. Implements envconfig.Unmarshal interface.