-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.go
More file actions
42 lines (34 loc) · 818 Bytes
/
logger.go
File metadata and controls
42 lines (34 loc) · 818 Bytes
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
package bpool
import (
"go.uber.org/zap"
)
// Logger is a BPool logger
type Logger struct {
z *zap.SugaredLogger
}
// Info wraps the zap infow
func (l *Logger) Info(msg string, args ...interface{}) {
l.z.Infow(msg, args...)
}
// Debug wraps the zap Debugw
func (l *Logger) Debug(msg string, args ...interface{}) {
l.z.Debugw(msg, args...)
}
// Warn wraps the zap Warnw
func (l *Logger) Warn(msg string, args ...interface{}) {
l.z.Warnw(msg, args...)
}
// Error wraps the zap Errorw
func (l *Logger) Error(msg string, args ...interface{}) {
l.z.Errorw(msg, args...)
}
// Panic wraps the zap Panicw
func (l *Logger) Panic(msg string, args ...interface{}) {
l.z.Panicw(msg, args...)
}
// NewBPoolLogger creates a new logger
func NewBPoolLogger(l *zap.SugaredLogger) *Logger {
return &Logger{
z: l,
}
}