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) }