summaryrefslogtreecommitdiff
path: root/cmd/rr/main.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-07-09 11:08:41 -0700
committerWolfy-J <[email protected]>2018-07-09 11:08:41 -0700
commitc7f3509ce37fcda22956a2d74c322ab84e23ea6c (patch)
tree472b95a4f18b34dbd10a80e0cdafc31b22f296d8 /cmd/rr/main.go
parent07e407e71bbc754fe1bc6dcff38cc0970509216d (diff)
debug mode moved to default cmd
Diffstat (limited to 'cmd/rr/main.go')
-rw-r--r--cmd/rr/main.go25
1 files changed, 1 insertions, 24 deletions
diff --git a/cmd/rr/main.go b/cmd/rr/main.go
index 03bef9bd..4d66177a 100644
--- a/cmd/rr/main.go
+++ b/cmd/rr/main.go
@@ -30,38 +30,15 @@ import (
"github.com/spiral/roadrunner/service/rpc"
"github.com/spiral/roadrunner/service/static"
- // cli plugins
- "github.com/spiral/roadrunner/cmd/rr/debug"
+ // additional command handlers
_ "github.com/spiral/roadrunner/cmd/rr/http"
-
- "github.com/sirupsen/logrus"
- "github.com/spf13/cobra"
)
-var debugMode bool
-
func main() {
- // forcing text based logging
- rr.Logger.Formatter = &logrus.TextFormatter{ForceColors: true}
-
- // provides ability to make local connection to services
rr.Container.Register(rpc.ID, &rpc.Service{})
-
- // http serving
rr.Container.Register(http.ID, &http.Service{})
-
- // serving static files
rr.Container.Register(static.ID, &static.Service{})
- // debug mode
- rr.CLI.PersistentFlags().BoolVarP(&debugMode, "debug", "d", false, "debug mode")
- cobra.OnInitialize(func() {
- if debugMode {
- service, _ := rr.Container.Get(http.ID)
- service.(*http.Service).AddListener(debug.Listener(rr.Logger))
- }
- })
-
// you can register additional commands using cmd.CLI
rr.Execute()
}