metric

package
v1.9.18 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelFieldName = "level"
)

Variables

View Source
var Component = &app.Component{
	Dependencies: app.Components{
		logger.Component,
	},
	Run: func(c container.Container) error {
		return c.Invoke(func(appConfig *app.Config, logger *logrus.Logger) {
			logger.AddHook(NewCounterHook(appConfig, logrus.ErrorLevel, logrus.WarnLevel))
			logger.Info("logger: add hook metric")
		})
	},
}

Functions

This section is empty.

Types

type CounterHook

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

func NewCounterHook

func NewCounterHook(appConfig *app.Config, levels ...logrus.Level) *CounterHook

func (*CounterHook) Fire

func (hook *CounterHook) Fire(entry *logrus.Entry) error

func (*CounterHook) Levels

func (hook *CounterHook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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