From 75fc168de27fa7d25ececc9d11e61e8c020f7462 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Mon, 27 Jun 2022 14:50:16 +0100 Subject: [PATCH] Tweak startup logging --- cmd/rp-indexer/main.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/rp-indexer/main.go b/cmd/rp-indexer/main.go index c582fdb..49379c4 100644 --- a/cmd/rp-indexer/main.go +++ b/cmd/rp-indexer/main.go @@ -26,17 +26,15 @@ func main() { loader := ezconf.NewLoader(cfg, "indexer", "Indexes RapidPro contacts to ElasticSearch", []string{"indexer.toml"}) loader.MustLoad() - log.WithField("version", version).WithField("released", date).Info("starting indexer") - - // configure our logger - log.SetOutput(os.Stdout) - log.SetFormatter(&log.TextFormatter{}) - level, err := log.ParseLevel(cfg.LogLevel) if err != nil { log.Fatalf("Invalid log level '%s'", level) } + log.SetLevel(level) + log.SetOutput(os.Stdout) + log.SetFormatter(&log.TextFormatter{}) + log.WithField("version", version).WithField("released", date).Info("starting indexer") // if we have a DSN entry, try to initialize it if cfg.SentryDSN != "" {