Skip to content

Commit

Permalink
drainer: Log version info before other logs, fix #242 (#638)
Browse files Browse the repository at this point in the history
So that users can easily see which version of drainer is running
when it fails to start.
  • Loading branch information
suzaku authored and july2993 committed Jun 18, 2019
1 parent d54d6b9 commit 62c5a9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/drainer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
rand.Seed(time.Now().UTC().UnixNano())

version.PrintVersionInfo("Drainer")

cfg := drainer.NewConfig()
if err := cfg.Parse(os.Args[1:]); err != nil {
log.Fatal("verifying flags failed, See 'drainer --help'.", zap.Error(err))
Expand All @@ -42,7 +44,6 @@ func main() {
if err := util.InitLogger(cfg.LogLevel, cfg.LogFile); err != nil {
log.Fatal("Failed to initialize log", zap.Error(err))
}
version.PrintVersionInfo("Drainer")
log.Info("start drainer...", zap.Reflect("config", cfg))

bs, err := drainer.NewServer(cfg)
Expand Down

0 comments on commit 62c5a9e

Please sign in to comment.