-
Notifications
You must be signed in to change notification settings - Fork 9
/
log.go
58 lines (48 loc) · 2.07 KB
/
log.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package rabbit
// Logger is the common interface for user-provided loggers.
type Logger interface {
// Debug sends out a debug message with the given arguments to the logger.
Debug(args ...interface{})
// Debugf formats a debug message using the given arguments and sends it to the logger.
Debugf(format string, args ...interface{})
// Info sends out an informational message with the given arguments to the logger.
Info(args ...interface{})
// Infof formats an informational message using the given arguments and sends it to the logger.
Infof(format string, args ...interface{})
// Warn sends out a warning message with the given arguments to the logger.
Warn(args ...interface{})
// Warnf formats a warning message using the given arguments and sends it to the logger.
Warnf(format string, args ...interface{})
// Error sends out an error message with the given arguments to the logger.
Error(args ...interface{})
// Errorf formats an error message using the given arguments and sends it to the logger.
Errorf(format string, args ...interface{})
}
// NoOpLogger is a do-nothing logger; it is used internally
// as the default Logger when none is provided in the Options.
type NoOpLogger struct {
}
// Debug is no-op implementation of Logger's Debug.
func (l *NoOpLogger) Debug(args ...interface{}) {
}
// Debugf is no-op implementation of Logger's Debugf.
func (l *NoOpLogger) Debugf(format string, args ...interface{}) {
}
// Info is no-op implementation of Logger's Info.
func (l *NoOpLogger) Info(args ...interface{}) {
}
// Infof is no-op implementation of Logger's Infof.
func (l *NoOpLogger) Infof(format string, args ...interface{}) {
}
// Warn is no-op implementation of Logger's Warn.
func (l *NoOpLogger) Warn(args ...interface{}) {
}
// Warnf is no-op implementation of Logger's Warnf.
func (l *NoOpLogger) Warnf(format string, args ...interface{}) {
}
// Error is no-op implementation of Logger's Error.
func (l *NoOpLogger) Error(args ...interface{}) {
}
// Errorf is no-op implementation of Logger's Errorf.
func (l *NoOpLogger) Errorf(format string, args ...interface{}) {
}