From 37afa6ce04434b81fcb242f1160938f1cddbde1e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 14 May 2024 07:57:48 +0200 Subject: feat: rely on system to show log times in production --- searchix.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'searchix.go') diff --git a/searchix.go b/searchix.go index 9a0b16e..4a511bf 100644 --- a/searchix.go +++ b/searchix.go @@ -51,7 +51,11 @@ func main() { 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) -- cgit 1.4.1