diff options
author | Julien Dessaux | 2024-12-31 11:29:58 +0100 |
---|---|---|
committer | Julien Dessaux | 2024-12-31 11:29:58 +0100 |
commit | 65e66b5e389f63eafe5d5902946b6fec974abe85 (patch) | |
tree | ca3062dc4513dd77f719042227d52831733b7d4c /pkg | |
parent | chore(tfstated): refactor backend code to a dedicated package (diff) | |
download | tfstated-65e66b5e389f63eafe5d5902946b6fec974abe85.tar.gz tfstated-65e66b5e389f63eafe5d5902946b6fec974abe85.tar.bz2 tfstated-65e66b5e389f63eafe5d5902946b6fec974abe85.zip |
chore(tfstated): prepare for listening on a second port
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/backend/run.go | 7 |
1 files changed, 3 insertions, 4 deletions
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) } }() |