-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
79 lines (59 loc) · 1.53 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package grpczerolog
import (
"fmt"
"github.com/rs/zerolog"
)
type Logger struct {
log zerolog.Logger
}
func New(log zerolog.Logger) Logger {
return Logger{log: log}
}
func (l Logger) Fatal(args ...interface{}) {
l.log.Fatal().Msg(fmt.Sprint(args...))
}
func (l Logger) Fatalf(format string, args ...interface{}) {
l.log.Fatal().Msg(fmt.Sprintf(format, args...))
}
func (l Logger) Fatalln(args ...interface{}) {
l.Fatal(args...)
}
func (l Logger) Error(args ...interface{}) {
l.log.Error().Msg(fmt.Sprint(args...))
}
func (l Logger) Errorf(format string, args ...interface{}) {
l.log.Error().Msg(fmt.Sprintf(format, args...))
}
func (l Logger) Errorln(args ...interface{}) {
l.Error(args...)
}
func (l Logger) Info(args ...interface{}) {
l.log.Info().Msg(fmt.Sprint(args...))
}
func (l Logger) Infof(format string, args ...interface{}) {
l.log.Info().Msg(fmt.Sprintf(format, args...))
}
func (l Logger) Infoln(args ...interface{}) {
l.Info(args...)
}
func (l Logger) Warning(args ...interface{}) {
l.log.Warn().Msg(fmt.Sprint(args...))
}
func (l Logger) Warningf(format string, args ...interface{}) {
l.log.Warn().Msg(fmt.Sprintf(format, args...))
}
func (l Logger) Warningln(args ...interface{}) {
l.Warning(args...)
}
func (l Logger) Print(args ...interface{}) {
l.log.Info().Msg(fmt.Sprint(args...))
}
func (l Logger) Printf(format string, args ...interface{}) {
l.log.Info().Msg(fmt.Sprintf(format, args...))
}
func (l Logger) Println(args ...interface{}) {
l.Print(args...)
}
func (l Logger) V(level int) bool {
return true
}