1 Star 0 Fork 0

xingyp / cn-infra

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.go 944 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ondrej Fabry 提交于 2018-07-31 14:12 . Cleanup log manager
package logmanager
// NewConf creates default configuration with InfoLevel & empty loggers.
// Suitable also for usage in flavor to programmatically specify default behavior.
func NewConf() *Config {
return &Config{
DefaultLevel: "",
Loggers: []LoggerConfig{},
Hooks: make(map[string]HookConfig),
}
}
// Config is a binding that supports to define default log levels for multiple loggers
type Config struct {
DefaultLevel string `json:"default-level"`
Loggers []LoggerConfig `json:"loggers"`
Hooks map[string]HookConfig `json:"hooks"`
}
// LoggerConfig is configuration of a particular logger.
// Currently we support only logger level.
type LoggerConfig struct {
Name string
Level string //debug, info, warn, error, fatal, panic
}
// HookConfig contains configuration of hook services
type HookConfig struct {
Protocol string
Address string
Port int
Levels []string
}
1
https://gitee.com/xingyp/cn-infra.git
git@gitee.com:xingyp/cn-infra.git
xingyp
cn-infra
cn-infra
v2.2.0

搜索帮助