Exemple #1
0
// Parse "log" section.
func (c *Config) parseLogSection(conf *entity.Config, section map[interface{}]interface{}) (err error) {
	logging, ok := section["logging"].(bool)
	if !ok || !logging {
		conf.Logging = false
		return
	}
	conf.Logging = true

	logPath, ok := section["path"].(string)
	if !ok || len(logPath) == 0 {
		err = errors.New("'path' must be specified.")
		return
	}
	conf.LogPath = logPath
	return
}