diff --git a/internal/cli/root.go b/internal/cli/root.go index 948520c..ab4d69f 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -30,7 +30,7 @@ func handleRootCmd(cmd *cobra.Command, args []string) { slog.Error("failed to initialize config", "error", err) os.Exit(1) } - log := logger.InitializeLogger() + log := logger.Initialize() config.SubstituteKeys(log) validation := config.IsValid() diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 4767184..333a97b 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -8,7 +8,8 @@ import ( "code.lila.network/adoralaura/certwarden-deploy/internal/configuration" ) -func InitializeLogger() *slog.Logger { +// Initialize initializes a *slog.Logger with the right log level and options. +func Initialize() *slog.Logger { logLevel := slog.LevelInfo if configuration.VerboseLogging {