-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabstract.go
77 lines (58 loc) · 1.73 KB
/
abstract.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
package gologger
import (
"fmt"
"net/http"
)
type AbstractLogger struct {
Logger
}
func (s *AbstractLogger) WithField(key string, value interface{}) Logger {
return s.WithFields(Fields{key: value})
}
//func (s *AbstractLogger) WithFields(fields Fields) Logger {
// panic("not implemented")
//}
func (s *AbstractLogger) WithError(err error) Logger {
return s.WithField("error", err)
//panic("not implemented")
}
func (s *AbstractLogger) WithRequest(req *http.Request) Logger {
return s.WithField("request", req)
}
//func (s *AbstractLogger) Log(level Level, args ...interface{}) {
// panic("not implemented")
//}
func (s *AbstractLogger) Logf(level Level, format string, args ...interface{}) {
s.Log(level, fmt.Sprintf(format, args...))
}
func (s *AbstractLogger) Debugf(format string, args ...interface{}) {
s.Logf(LevelDebug, format, args...)
}
func (s *AbstractLogger) Infof(format string, args ...interface{}) {
s.Logf(LevelInfo, format, args...)
}
func (s *AbstractLogger) Warningf(format string, args ...interface{}) {
s.Logf(LevelWarning, format, args...)
}
func (s *AbstractLogger) Errorf(format string, args ...interface{}) {
s.Logf(LevelError, format, args...)
}
func (s *AbstractLogger) Fatalf(format string, args ...interface{}) {
s.Logf(LevelFatal, format, args...)
}
func (s *AbstractLogger) Debug(args ...interface{}) {
s.Log(LevelDebug, args...)
}
func (s *AbstractLogger) Info(args ...interface{}) {
s.Log(LevelInfo, args...)
}
func (s *AbstractLogger) Warning(args ...interface{}) {
s.Log(LevelWarning, args...)
}
func (s *AbstractLogger) Error(args ...interface{}) {
s.Log(LevelError, args...)
}
func (s *AbstractLogger) Fatal(args ...interface{}) {
s.Log(LevelFatal, args...)
}
func (s *AbstractLogger) Close() {}