summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-logger/hook.go
blob: 2345ca93bf561c89fb89f4fdcbdc8069c17e7a9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package logger

// Hook defines a log Entry modifier
type Hook interface {
	Do(*Entry)
}

// HookFunc is a simple adapter to allow functions to satisfy the Hook interface
type HookFunc func(*Entry)

func (hook HookFunc) Do(entry *Entry) {
	hook(entry)
}