diff options
author | Wim <wim@42.be> | 2017-02-17 22:32:42 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-02-17 22:32:42 +0100 |
commit | 956d7cf3f31ea949a34537ff2f08a6b9f5918b6c (patch) | |
tree | e1c6fef3c099ac5362e53521b86cb8dd2937bbbf /matterbridge.go | |
parent | 7558a2162e79ffa29b11881fe249ec836a8c8b3d (diff) | |
download | matterbridge-msglm-956d7cf3f31ea949a34537ff2f08a6b9f5918b6c.tar.gz matterbridge-msglm-956d7cf3f31ea949a34537ff2f08a6b9f5918b6c.tar.bz2 matterbridge-msglm-956d7cf3f31ea949a34537ff2f08a6b9f5918b6c.zip |
Add githash to docker builds
Diffstat (limited to 'matterbridge.go')
-rw-r--r-- | matterbridge.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/matterbridge.go b/matterbridge.go index 32bc4285..7dfaaa22 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -9,7 +9,10 @@ import ( log "github.com/Sirupsen/logrus" ) -var version = "0.9.3-dev" +var ( + version = "0.9.3-dev" + githash string +) func init() { log.SetFormatter(&log.TextFormatter{FullTimestamp: true}) @@ -21,25 +24,25 @@ func main() { flagVersion := flag.Bool("version", false, "show version") flag.Parse() if *flagVersion { - fmt.Println("version:", version) + fmt.Printf("version: %s %s\n", version, githash) return } flag.Parse() if *flagDebug { - log.Info("enabling debug") + log.Info("Enabling debug") log.SetLevel(log.DebugLevel) } - fmt.Println("running version", version) + log.Printf("Running version %s %s", version, githash) cfg := config.NewConfig(*flagConfig) for _, gw := range cfg.SameChannelGateway { if !gw.Enable { continue } - fmt.Printf("starting samechannel gateway %#v\n", gw.Name) + log.Printf("Starting samechannel gateway %#v", gw.Name) g := samechannelgateway.New(cfg, &gw) err := g.Start() if err != nil { - log.Fatalf("starting gateway failed %#v", err) + log.Fatalf("Starting gateway failed %#v", err) } } @@ -47,11 +50,11 @@ func main() { if !gw.Enable { continue } - fmt.Printf("starting gateway %#v\n", gw.Name) + log.Printf("Starting gateway %#v", gw.Name) g := gateway.New(cfg, &gw) err := g.Start() if err != nil { - log.Fatalf("starting gateway failed %#v", err) + log.Fatalf("Starting gateway failed %#v", err) } } select {} |