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 { appConfig, err := container.Get[*app.Config](c) if err != nil { return err } l, err := container.Get[*logrus.Logger](c) if err != nil { return err } l.AddHook(NewCounterHook(appConfig, logrus.ErrorLevel, logrus.WarnLevel)) l.Info("logger: add hook metric") return nil }, }
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) Levels ¶
func (hook *CounterHook) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.