diff options
author | Alan Pearce | 2024-05-14 07:57:48 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-14 07:57:48 +0200 |
commit | 37afa6ce04434b81fcb242f1160938f1cddbde1e (patch) | |
tree | 41ea4f1b4b1990757ef958e3508bdbd6b29600ee | |
parent | 3fd832b8f86641ea6046a776dda8f54a17834d7b (diff) | |
download | searchix-37afa6ce04434b81fcb242f1160938f1cddbde1e.tar.lz searchix-37afa6ce04434b81fcb242f1160938f1cddbde1e.tar.zst searchix-37afa6ce04434b81fcb242f1160938f1cddbde1e.zip |
feat: rely on system to show log times in production
-rw-r--r-- | searchix.go | 6 |
1 files changed, 5 insertions, 1 deletions
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) |