forked from wagslane/go-rabbitmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
44 lines (33 loc) · 1.12 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package rabbitmq
import (
"fmt"
"log"
"github.com/wagslane/go-rabbitmq/internal/logger"
)
// Logger is describes a logging structure. It can be set using
// WithPublisherOptionsLogger() or WithConsumerOptionsLogger().
type Logger logger.Logger
const loggingPrefix = "gorabbit"
type stdDebugLogger struct{}
// Fatalf -
func (l stdDebugLogger) Fatalf(format string, v ...interface{}) {
log.Printf(fmt.Sprintf("%s FATAL: %s", loggingPrefix, format), v...)
}
// Errorf -
func (l stdDebugLogger) Errorf(format string, v ...interface{}) {
log.Printf(fmt.Sprintf("%s ERROR: %s", loggingPrefix, format), v...)
}
// Warnf -
func (l stdDebugLogger) Warnf(format string, v ...interface{}) {
log.Printf(fmt.Sprintf("%s WARN: %s", loggingPrefix, format), v...)
}
// Infof -
func (l stdDebugLogger) Infof(format string, v ...interface{}) {
log.Printf(fmt.Sprintf("%s INFO: %s", loggingPrefix, format), v...)
}
// Debugf -
func (l stdDebugLogger) Debugf(format string, v ...interface{}) {
log.Printf(fmt.Sprintf("%s DEBUG: %s", loggingPrefix, format), v...)
}
// Tracef -
func (l stdDebugLogger) Tracef(format string, v ...interface{}) {}