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 }
func main() { // Initialize logging to a default INFO level to be able to log config error. conf.ParseConfigParameters() if len(conf.CFG.Profiler) > 0 { go func() { if err := http.ListenAndServe(conf.CFG.Profiler, nil); err != nil { log.Error("Could not initialize profiler: %v", err) } }() } // Reinitialize log level according to the config data. log.InitLogging() srv, err := server.Server(server.SimpleServerType, conf.CFG.FMPQServerInterface) if err != nil { log.Critical("Error: %s", err.Error()) return } srv.Start() }