Exemplo n.º 1
0
func findLogFiles(location string) (BinaryLogs, error) {
	items, err := ioutil.ReadDir(location)
	if err != nil {
		log.Critical("Can't read binary log directory: %s", err.Error())
		return nil, err
	}
	return extractLogFiles(items), nil
}
Exemplo n.º 2
0
func main() {
	// Initialize logging to a default INFO level to be able to log config error.
	log.InitLogging()

	err := conf.ReadConfig()
	if err != nil {
		log.Error(err.Error())
		return
	}
	// Reinitialize log level according to the config data.
	log.InitLogging()

	iface := fmt.Sprintf("%s:%d", conf.CFG.Interface, conf.CFG.Port)
	srv, err := server.GetServer(server.SIMPLE_SERVER, iface)
	if err != nil {
		log.Critical("Error: %s", err.Error())
		return
	}
	srv.Start()

}