-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
30 lines (25 loc) · 850 Bytes
/
logger.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
package hoverdnsapi
import (
"log"
)
// YALI -- Yet Another Logger Interface -- reduces the logger facility needed to as few functions
// as possible to allow others to be slotted in.
type YALI interface {
Printf(format string, v ...interface{})
Println(v ...interface{})
}
// NopLogger reduces spin while not logging
// https://gist.github.com/Avinash-Bhat/48c4f06b0cc840d9fd6c#file-log_test-go
//
// Intended to be a compatible implementation for YALI for low-cost log discarding
type NopLogger struct {
*log.Logger
}
// Printf offers a relatively efficient discarding function for log messages when not logging
func (l *NopLogger) Printf(format string, v ...interface{}) {
// noop
}
// Println offers a relatively efficient discarding function for log messages when not logging
func (l *NopLogger) Println(v ...interface{}) {
// noop
}