logger

package
v0.0.0-...-91e7bcc Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default() *logrus.Logger

Default returns pre-configured logger.

func New

func New(cfg Config) (*logrus.Logger, error)

New returns logger with config.

Types

type Config

type Config struct {
	FileOut string `split_words:"true"`
	FileErr string `split_words:"true"`
}

type Hook

type Hook struct {
	Writer    io.Writer
	LogLevels []log.Level
}

Hook is a hook that writes logs of specified LogLevels to specified Writer

func (*Hook) Fire

func (hook *Hook) Fire(entry *log.Entry) error

Fire will be called when some logging function is called with current hook It will format log entry to string and write it to appropriate writer

func (*Hook) Levels

func (hook *Hook) Levels() []log.Level

Levels define on which log levels this hook would trigger

Jump to

Keyboard shortcuts

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