12345678910111213141516171819202122 |
- package config
- import "github.com/natefinch/lumberjack"
- var (
- _loggerConfig *LoggerConfig
- )
- type LoggerConfig struct {
- Level string `yaml:"level,omitempty"`
- Lumberjack *lumberjack.Logger `yaml:"lumberjack,omitempty"`
- }
- func InitLogger(path string) {
- var config LoggerConfig
- readConfig(path, &config)
- _loggerConfig = &config
- }
- func GetLoggerConfig() LoggerConfig {
- return *_loggerConfig
- }
|