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) Levels ¶
func (hook *CounterHook) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.