summaryrefslogtreecommitdiff
path: root/cmd/rr/http/debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/rr/http/debug.go')
-rw-r--r--cmd/rr/http/debug.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmd/rr/http/debug.go b/cmd/rr/http/debug.go
index d02cfda6..cae10452 100644
--- a/cmd/rr/http/debug.go
+++ b/cmd/rr/http/debug.go
@@ -1 +1,20 @@
package http
+
+import (
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+
+ "github.com/spf13/cobra"
+ "github.com/spiral/roadrunner/service/http"
+ "github.com/spiral/roadrunner/cmd/rr/debug"
+)
+
+func init(){
+ cobra.OnInitialize(func() {
+ if rr.Debug {
+ svc, _ := rr.Container.Get(http.ID)
+ if svc, ok := svc.(*http.Service); ok {
+ svc.AddListener(debug.Listener(rr.Logger))
+ }
+ }
+ })
+} \ No newline at end of file