From 65e66b5e389f63eafe5d5902946b6fec974abe85 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 31 Dec 2024 11:29:58 +0100 Subject: chore(tfstated): prepare for listening on a second port --- pkg/backend/run.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pkg/backend/run.go') diff --git a/pkg/backend/run.go b/pkg/backend/run.go index dd7f3bf..a6d2f03 100644 --- a/pkg/backend/run.go +++ b/pkg/backend/run.go @@ -2,9 +2,8 @@ package backend import ( "context" - "fmt" "io" - "log" + "log/slog" "net" "net/http" @@ -41,9 +40,9 @@ func Run( Handler: logger.Middleware(mux, false), } go func() { - log.Printf("listening on %s\n", httpServer.Addr) + slog.Info("backend http server listening", "address", httpServer.Addr) if err := httpServer.ListenAndServe(); err != nil && err != http.ErrServerClosed { - _, _ = fmt.Fprintf(stderr, "error listening and serving: %+v\n", err) + slog.Error("error listening and serving backend http server", "address", httpServer.Addr, "error", err) } }() -- cgit v1.2.3