logger

package
v0.0.0-...-1b19c93 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

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