func (c *RunCommand) Execute(context *cli.Context) { svcConfig := &service.Config{ Name: c.ServiceName, DisplayName: c.ServiceName, Description: defaultDescription, Arguments: []string{"run"}, } service, err := service_helpers.New(c, svcConfig) if err != nil { log.Fatalln(err) } if c.Syslog { logger, err := service.SystemLogger(nil) if err == nil { log.AddHook(&ServiceLogHook{logger}) } else { log.Errorln(err) } } err = service.Run() if err != nil { log.Fatalln(err) } }
func (mr *RunCommand) Execute(context *cli.Context) { svcConfig := &service.Config{ Name: mr.ServiceName, DisplayName: mr.ServiceName, Description: defaultDescription, Arguments: []string{"run"}, Option: service.KeyValue{ "RunWait": mr.runWait, }, } service, err := service_helpers.New(mr, svcConfig) if err != nil { log.Fatalln(err) } if mr.Syslog { log.SetFormatter(new(log.TextFormatter)) logger, err := service.SystemLogger(nil) if err == nil { log.AddHook(&ServiceLogHook{logger, log.InfoLevel}) } else { log.Errorln(err) } } log.AddHook(&mr.sentryLogHook) err = service.Run() if err != nil { log.Fatalln(err) } }