func Load()

in config/monkey.go [91:120]


func Load(configPaths []string) (*Monkey, error) {
	m := &Monkey{v: viper.New()}

	m.setDefaults()
	m.setupEnvVarReader()

	for _, dir := range configPaths {
		m.v.AddConfigPath(dir)
	}

	m.v.SetConfigType("toml")
	m.v.SetConfigName("chaosmonkey")

	err := m.v.ReadInConfig()
	// It's ok if the config file doesn't exist, but we want to catch any
	// other config-related issues
	if err != nil {
		if !os.IsNotExist(err) {
			return nil, errors.Wrapf(err, "failed to read config file")
		}

		log.Printf("no config file found, proceeding without one")
	}

	err = m.configureRemote()
	if err != nil {
		return nil, err
	}
	return m, nil
}