-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtrace.go
More file actions
27 lines (23 loc) · 1.01 KB
/
trace.go
File metadata and controls
27 lines (23 loc) · 1.01 KB
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
package aliyuniot
// Logger is the fundamental interface for all log operations. 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.
// from github.com/go-kit/kit/log
type Logger interface {
Log(keyvals ...interface{}) error
}
// NOOPLogger implements the logger that does not perform any operation
// by default. This allows us to efficiently discard the unwanted messages.
type NOOPLogger struct{}
// Log do nothing
func (l *NOOPLogger) Log(keyvals ...interface{}) error { return nil }
// Internal levels of library output that are initialised to not print
// anything but can be overridden by programmer
var (
Error Logger = &NOOPLogger{}
Critical Logger = &NOOPLogger{}
Warning Logger = &NOOPLogger{}
Debug Logger = &NOOPLogger{}
)