logmetrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMetrics = NewMetrics()

Functions

This section is empty.

Types

type Metrics

type Metrics map[logrus.Level]prometheus.Counter

Metrics is a logrus hook-compliant struct that records metrics about logging when added to a logrus.Logger

func New

func New() (l *log.Entry, m *Metrics)

New creates a new logger according to horizon specifications.

func NewMetrics

func NewMetrics() *Metrics

NewMetrics creates a new hook for recording metrics.

func (*Metrics) Fire

func (m *Metrics) Fire(e *logrus.Entry) error

Fire is triggered by logrus, in response to a logging event

func (*Metrics) Levels

func (m *Metrics) Levels() []logrus.Level

Levels returns the logging levels that will trigger this hook to run. In this case, all of them.

Jump to

Keyboard shortcuts

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