From 6b3c7973dcdc307d34c99d88a353c3fd27ea2abf Mon Sep 17 00:00:00 2001 From: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:46:40 +0200 Subject: [PATCH] fix(serve): only print with zerolog (#8) --- pkg/network/serve.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/network/serve.go b/pkg/network/serve.go index 35fd025..c2fe954 100644 --- a/pkg/network/serve.go +++ b/pkg/network/serve.go @@ -2,7 +2,6 @@ package network import ( "fmt" - "log" "net/http" "os" "strconv" @@ -118,7 +117,7 @@ func setupCacheUpdater(ovhClient *ovh.Client) { intervalStr := os.Getenv("OVH_CACHE_UPDATE_INTERVAL") intervalSeconds, err := strconv.Atoi(intervalStr) if err != nil { - log.Fatalf("Failed to parse OVH_CACHE_UPDATE_INTERVAL: %v", err) + logger.Fatal().Msgf("Failed to parse OVH_CACHE_UPDATE_INTERVAL: %v", err) } cacheUpdateInterval := time.Duration(intervalSeconds) * time.Second @@ -144,7 +143,7 @@ func serveRoutes(clicontext *cli.Context) error { os.Getenv("OVH_CONSUMER_KEY"), ) if err != nil { - log.Fatalf("Failed to create OVH client: %v", err) + logger.Fatal().Msgf("Failed to create OVH client: %v", err) } http.HandleFunc("/ping", pingHandler)