Skip to content

Commit

Permalink
Tweak startup logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Jun 27, 2022
1 parent 81d61a8 commit 75fc168
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cmd/rp-indexer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 75fc168

Please sign in to comment.