X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/95159e5585762c06c654945070ba54262b7dcec9..f8e4cd540b87de3e308ec18a2b040b284a741522:/cmd/mobius-hotline-server/main.go?ds=inline diff --git a/cmd/mobius-hotline-server/main.go b/cmd/mobius-hotline-server/main.go index 8e66938..c34dc71 100644 --- a/cmd/mobius-hotline-server/main.go +++ b/cmd/mobius-hotline-server/main.go @@ -99,7 +99,7 @@ func main() { } if _, err := os.Stat(*configDir); os.IsNotExist(err) { - slogger.Error(fmt.Sprintf("Configuration directory not found. Correct the path or re-run with -init to generate initial config.")) + slogger.Error("Configuration directory not found. Correct the path or re-run with -init to generate initial config.") os.Exit(1) } @@ -122,6 +122,12 @@ func main() { }(srv) } + slogger.Info("Hotline server started", + "version", version, + "API port", fmt.Sprintf("%s:%v", *netInterface, *basePort), + "Transfer port", fmt.Sprintf("%s:%v", *netInterface, *basePort+1), + ) + // Serve Hotline requests until program exit log.Fatal(srv.ListenAndServe(ctx, cancel)) } @@ -139,7 +145,9 @@ func (sh *statHandler) RenderStats(w http.ResponseWriter, _ *http.Request) { _, _ = io.WriteString(w, string(u)) } -func defaultConfigPath() (cfgPath string) { +func defaultConfigPath() string { + var cfgPath string + switch runtime.GOOS { case "windows": cfgPath = "config/"