From c0e7fa98ed3062ed9dbe4d593983dc860e3975c8 Mon Sep 17 00:00:00 2001 From: kianaza Date: Sat, 6 Jul 2024 02:28:29 +0330 Subject: [PATCH] fix: fix logging section in config file --- internal/cmd/root.go | 3 --- internal/config/config.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 5357de9..5b4d721 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -1,7 +1,6 @@ package cmd import ( - "fmt" "os" "github.com/snapp-incubator/nats-blackbox-exporter/internal/config" @@ -20,8 +19,6 @@ func Execute() { pflag.StringVar(&settingsPath, "settings", "/opt/nats-blackbox-exporter/settings.yml", "Path to settings file") pflag.Parse() - fmt.Println("settingsPath", settingsPath) - cfg := config.New(settingsPath) logger := logger.New(cfg.Logger) diff --git a/internal/config/config.go b/internal/config/config.go index 719447d..305de67 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -43,7 +43,7 @@ func New(settingsPath string) Config { // load configuration from file if err := k.Load(file.Provider(settingsPath), yaml.Parser()); err != nil { - log.Printf("error loading config.yaml") + log.Printf("error loading config.yaml from: %s", settingsPath) } // load environment variables