fix: duplicate error logging on config parse error
Alan Pearce alan@alanpearce.eu
Fri, 17 May 2024 23:21:59 +0200
1 files changed, 3 insertions(+), 1 deletions(-)
jump to
M searchix.go → searchix.go
@@ -62,7 +62,9 @@ } cfg, err := config.GetConfig(*configFile) if err != nil { - log.Panicf("error parsing configuration file: %v", err) + // only use log functions after the config file has been read successfully + fmt.Fprintf(os.Stderr, "error parsing configuration file: %v", err) + os.Exit(1) } slog.SetLogLoggerLevel(cfg.LogLevel) if cfg.Web.Environment == "production" {