-
Notifications
You must be signed in to change notification settings - Fork 4
/
logger.go
19 lines (15 loc) · 759 Bytes
/
logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package scep
// Logger is the fundamental interface for all SCEP logging operations. It
// has the same signature as the `github.com/go-kit/kit/log` interface, to
// allow for interop between the two. Log creates a log event from keyvals,
// a variadic sequence of alternating keys and values. Implementations must
// be safe for concurrent use by multiple goroutines. In particular, any
// implementation of Logger that appends to keyvals or modifies or retains
// any of its elements must make a copy first.
type Logger interface {
Log(keyvals ...interface{}) error
}
type nopLogger struct{}
// newNopLogger returns a logger that logs nothing.
func newNopLogger() Logger { return nopLogger{} }
func (nopLogger) Log(...interface{}) error { return nil }