log

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VerboseDefault is using debug log level on default for Config.InfoLevel
	VerboseDefault = false

	// InfoLevelFieldName field name in configuration file or ENV name for value of Config.InfoLevel
	InfoLevelFieldName  = "logger.level.info"
	DebugLevelFieldName = "logger.level.debug"

	// SentryDSNFieldName field name in configuration file or ENV name for value of Config.SentryDSN
	SentryDSNFieldName = "logger.sentry.dsn"
)

Variables

This section is empty.

Functions

func NewLogrus

func NewLogrus(config *Config, appConfig *app.Config, metrics *metrics.Metrics) (*logrus.Logger, error)

NewLogrus creating and configuration instance of logrus.Logger which implements Logger

func WithConfigurator

func WithConfigurator(config *Config, appConfig *app.Config, configurator configurator.Configurator, metrics *metrics.Metrics) (*logrus.Logger, error)

Types

type Config

type Config struct {
	// InfoLevel if true then logger using debug log level
	InfoLevel  bool
	DebugLevel bool

	// SentryDSN Sentry connection string
	SentryDSN string
}

Config setup params for logger

func NewConfig

func NewConfig() *Config

NewConfig creating and return new structure instance Config

type Debuger

type Debuger interface {
	Debugf(string, ...interface{})
	Debug(...interface{})
}

type Informer

type Informer interface {
	Infof(string, ...interface{})
	Info(...interface{})
}

type Logger

type Logger interface {
	Debuger
	Informer
	Warner
	Printer

	Errorf(string, ...interface{})
	Error(...interface{})
}

Logger general of logger interface for any implementation

type Printer

type Printer interface {
	Print(...interface{})
}

type Warner

type Warner interface {
	Warnf(string, ...interface{})
	Warn(...interface{})
}

Jump to

Keyboard shortcuts

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