-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.go
31 lines (26 loc) · 856 Bytes
/
conf.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 glog
import "github.com/sirupsen/logrus"
type Conf struct {
LogDir string
LogLevel LogLevel
LogFileCount uint
IsStdoutPrint bool // 是否将日志输出到标准输出
CallerPrintLevels []LogLevel
}
type LogLevel logrus.Level
const (
PanicLevel LogLevel = LogLevel(logrus.PanicLevel)
FatalLevel LogLevel = LogLevel(logrus.FatalLevel)
ErrorLevel LogLevel = LogLevel(logrus.ErrorLevel)
WarnLevel LogLevel = LogLevel(logrus.WarnLevel)
InfoLevel LogLevel = LogLevel(logrus.InfoLevel)
DebugLevel LogLevel = LogLevel(logrus.DebugLevel)
TraceLevel LogLevel = LogLevel(logrus.TraceLevel)
)
var DefaultConf = Conf{
LogDir: "./logs",
LogLevel: InfoLevel,
LogFileCount: 24,
IsStdoutPrint: false,
CallerPrintLevels: []LogLevel{PanicLevel, FatalLevel, ErrorLevel, WarnLevel},
}