Skip to content

Commit 9b707dd

Browse files
authored
Merge pull request nyaruka#52 from nyaruka/inc_build_version
Log app version on startup
2 parents 3a25a43 + 4b923c7 commit 9b707dd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/rp-indexer/main.go

+8
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@ import (
1515
log "github.com/sirupsen/logrus"
1616
)
1717

18+
var (
19+
// https://goreleaser.com/cookbooks/using-main.version
20+
version = "dev"
21+
date = "unknown"
22+
)
23+
1824
func main() {
1925
cfg := indexer.NewDefaultConfig()
2026
loader := ezconf.NewLoader(cfg, "indexer", "Indexes RapidPro contacts to ElasticSearch", []string{"indexer.toml"})
2127
loader.MustLoad()
2228

29+
log.WithField("version", version).WithField("released", date).Info("starting indexer")
30+
2331
// configure our logger
2432
log.SetOutput(os.Stdout)
2533
log.SetFormatter(&log.TextFormatter{})

0 commit comments

Comments
 (0)