forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging.go
31 lines (24 loc) · 797 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
package loggingtest
import (
"io"
"log"
"os"
"github.com/influxdata/kapacitor/services/logging"
"github.com/influxdata/wlog"
)
type TestLogService struct{}
func New() TestLogService {
return TestLogService{}
}
func (l TestLogService) NewLogger(prefix string, flag int) *log.Logger {
return wlog.New(os.Stderr, prefix, flag)
}
func (l TestLogService) NewRawLogger(prefix string, flag int) *log.Logger {
return log.New(os.Stderr, prefix, flag)
}
func (l TestLogService) NewStaticLevelLogger(prefix string, flag int, level logging.Level) *log.Logger {
return log.New(wlog.NewStaticLevelWriter(os.Stderr, wlog.Level(level)), prefix, flag)
}
func (l TestLogService) NewStaticLevelWriter(level logging.Level) io.Writer {
return wlog.NewStaticLevelWriter(os.Stderr, wlog.Level(level))
}