forked from tzmfreedom/spm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.go
46 lines (37 loc) · 924 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
41
42
43
44
45
46
package main
import (
"github.com/Sirupsen/logrus"
"io"
)
type Logger struct {
OutLogger *logrus.Logger
ErrLogger *logrus.Logger
}
func NewLogger(outStream io.Writer, errStream io.Writer) *Logger {
outLogger := logrus.New()
outLogger.Out = outStream
errLogger := logrus.New()
errLogger.Out = errStream
return &Logger{
OutLogger: outLogger,
ErrLogger: errLogger,
}
}
func (l *Logger) Info(args ...interface{}) {
l.OutLogger.Info(args...)
}
func (l *Logger) Infof(format string, args ...interface{}) {
l.OutLogger.Infof(format, args...)
}
func (l *Logger) Warning(args ...interface{}) {
l.OutLogger.Warning(args...)
}
func (l *Logger) Warningf(format string, args ...interface{}) {
l.OutLogger.Warningf(format, args...)
}
func (l *Logger) Error(args ...interface{}) {
l.OutLogger.Error(args...)
}
func (l *Logger) Errorf(format string, args ...interface{}) {
l.OutLogger.Errorf(format, args...)
}