-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlogger.go
40 lines (30 loc) · 883 Bytes
/
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
package xds
import (
"log"
"os"
envoylog "github.com/envoyproxy/go-control-plane/pkg/log"
)
// compile check
var (
_ envoylog.Logger = (*loggerSnapshotCache)(nil)
)
type loggerSnapshotCache struct{}
func (l *loggerSnapshotCache) Debugf(format string, args ...interface{}) {
log.Printf("debug: "+format, args...)
}
func (l *loggerSnapshotCache) Infof(format string, args ...interface{}) {
log.Printf("info: "+format, args...)
}
func (l *loggerSnapshotCache) Warnf(format string, args ...interface{}) {
log.Printf("warn: "+format, args...)
}
func (l *loggerSnapshotCache) Errorf(format string, args ...interface{}) {
log.Printf("error: "+format, args...)
}
func newLoggerSnapshotCache() *loggerSnapshotCache {
return new(loggerSnapshotCache)
}
func newLoggerAccessLog() *log.Logger {
// todo
return log.New(os.Stdout, "accesslog: ", log.Ldate|log.Lmicroseconds)
}