forked from ooni/probe-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging.go
41 lines (32 loc) · 985 Bytes
/
logging.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
package main
import "github.com/ooni/probe-cli/v3/internal/model"
// indexLogger is a logger with an index.
type indexLogger struct {
indexstr string
logger model.Logger
}
var _ model.Logger = &indexLogger{}
// Debug implements DebugLogger.Debug
func (p *indexLogger) Debug(msg string) {
p.logger.Debug(p.indexstr + msg)
}
// Debugf implements DebugLogger.Debugf
func (p *indexLogger) Debugf(format string, v ...interface{}) {
p.logger.Debugf(p.indexstr+format, v...)
}
// Info implements InfoLogger.Info
func (p *indexLogger) Info(msg string) {
p.logger.Info(p.indexstr + msg)
}
// Infov implements InfoLogger.Infov
func (p *indexLogger) Infof(format string, v ...interface{}) {
p.logger.Infof(p.indexstr+format, v...)
}
// Warn implements Logger.Warn
func (p *indexLogger) Warn(msg string) {
p.logger.Warn(p.indexstr + msg)
}
// Warnf implements Logger.Warnf
func (p *indexLogger) Warnf(format string, v ...interface{}) {
p.logger.Warnf(p.indexstr+format, v...)
}