-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.go
33 lines (28 loc) · 898 Bytes
/
config.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
package logger
type Config struct {
Colorful bool `yaml:"colorful"`
MaxBackups int `yaml:"max_backups"`
RotateLogAfterDays int `yaml:"rotate_log_after_days"`
Compress bool `yaml:"compress"`
Targets []string `yaml:"targets"`
Levels map[string]string `yaml:"levels"`
}
func DefaultConfig() *Config {
conf := &Config{
Levels: make(map[string]string),
Colorful: true,
MaxBackups: 0,
RotateLogAfterDays: 1,
Compress: true,
Targets: []string{"console", "file"},
}
conf.Levels["default"] = "info"
conf.Levels["_ai"] = "warn"
conf.Levels["_service"] = "info"
conf.Levels["_rest"] = "warn"
return conf
}
// BasicCheck performs basic checks on the configuration.
func (*Config) BasicCheck() error {
return nil
}