Exemplo n.º 1
0
func loadConfiguration() {
	reader, err := os.Open(*configPath)
	if err != nil {
		log.Alertf("Unable to read the configuration file (%v)", err.Error())
	}
	data, err := ioutil.ReadAll(reader)

	goyaml.Unmarshal(data, conf)
	if err != nil {
		log.Alert(err.Error())
	}
}
Exemplo n.º 2
0
func setupLogging() {
	// Setup the syslog backend
	writer, err := syslog.New(syslog.LOG_USER, "gobs")
	if err != nil {
		log.Alertf("Unable to initialize syslogging (%v)", err.Error())
	}
	syslogger := log.NewSyslogBackend(conf.Verbose, writer)
	log.AddBackend("syslog", syslogger)

	// Setup the std backend
	log.GetBackend("std").SetLevel(conf.Verbose)

	// Setup the logfile backend
	// @Todo
}