about summary refs log tree commit diff stats
path: root/searchix.go
diff options
context:
space:
mode:
Diffstat (limited to 'searchix.go')
-rw-r--r--searchix.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/searchix.go b/searchix.go
index ba33e3f..c2cd19d 100644
--- a/searchix.go
+++ b/searchix.go
@@ -62,7 +62,9 @@ func main() {
 
 	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" {