-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
34 lines (27 loc) · 878 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Package hooks provides several useful Logrus hooks
//
// These hooks are used as decorators of other hooks and provide enhanced
// functionality:
//
// - retry transmission with exponential backoff and jitter
// - rate limits on the number of logging messages
// - asynchronous execution
//
package hooks
import "github.com/sirupsen/logrus"
// Chain is a single-linked list of hooks that work together one after another
type Chain interface {
logrus.Hook
// Next is the element of the chain that follows this one
Next() logrus.Hook
}
// RunningHook is a Logrus hook that can be started and stopped
type RunningHook interface {
logrus.Hook
// IsRunning queries the state of the hook
IsRunning() bool
// Start prepares the hook to be able to send messages
Start() error
// Stop transitions the hook to a state in which it does not send messages
Stop() error
}