refactor logger init function
This commit is contained in:
parent
60aea576dc
commit
b988e4cf51
2 changed files with 3 additions and 2 deletions
|
@ -30,7 +30,7 @@ func handleRootCmd(cmd *cobra.Command, args []string) {
|
||||||
slog.Error("failed to initialize config", "error", err)
|
slog.Error("failed to initialize config", "error", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
log := logger.InitializeLogger()
|
log := logger.Initialize()
|
||||||
config.SubstituteKeys(log)
|
config.SubstituteKeys(log)
|
||||||
|
|
||||||
validation := config.IsValid()
|
validation := config.IsValid()
|
||||||
|
|
|
@ -8,7 +8,8 @@ import (
|
||||||
"code.lila.network/adoralaura/certwarden-deploy/internal/configuration"
|
"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
|
logLevel := slog.LevelInfo
|
||||||
|
|
||||||
if configuration.VerboseLogging {
|
if configuration.VerboseLogging {
|
||||||
|
|
Loading…
Reference in a new issue