From f466b042a3e8de060871b3849a77becc155606ea Mon Sep 17 00:00:00 2001 From: ayn2op Date: Fri, 20 Dec 2024 18:29:09 -0500 Subject: [PATCH] feat: add useful log messages --- internal/config/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 447a68a..7fa3b77 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,6 +1,7 @@ package config import ( + "log/slog" "os" "path/filepath" "time" @@ -47,6 +48,7 @@ func defaultConfig() *Config { func Load() (*Config, error) { path, err := os.UserConfigDir() if err != nil { + slog.Info("user configuration directory path cannot be determined; falling back to the current directory path") path = "." } @@ -55,6 +57,7 @@ func Load() (*Config, error) { cfg := defaultConfig() if os.IsNotExist(err) { + slog.Info("the configuration file does not exist, falling back to the default configuration", "path", path, "err", err) return cfg, nil }