all repos — searchix @ 37afa6ce04434b81fcb242f1160938f1cddbde1e

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: rely on system to show log times in production
Alan Pearce alan@alanpearce.eu
Tue, 14 May 2024 07:57:48 +0200
commit

37afa6ce04434b81fcb242f1160938f1cddbde1e

parent

3fd832b8f86641ea6046a776dda8f54a17834d7b

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M searchix.gosearchix.go
@@ -51,7 +51,11 @@ if err != nil { 		log.Panicf("error parsing configuration file: %v", err)
 	}
 	slog.SetLogLoggerLevel(conf.LogLevel)
-	log.SetFlags(log.LstdFlags | log.Lmsgprefix)
+	if conf.Web.Environment == "production" {
+		log.SetFlags(log.Lmsgprefix)
+	} else {
+		log.SetFlags(log.LstdFlags | log.Lmsgprefix)
+	}
 	log.SetPrefix("searchix: ")
 
 	read, write, exists, err := index.OpenOrCreate(conf.DataPath, *replace)