summaryrefslogtreecommitdiff
path: root/cmd/rr/http/debug.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-07 23:37:28 +0300
committerWolfy-J <[email protected]>2018-09-07 23:37:28 +0300
commit4dea95a525707af1a726e9af024e4abdbde28820 (patch)
tree14a8f49a93a48c1fba3d8e080ebc0b71301473c9 /cmd/rr/http/debug.go
parentf0bc4fc0da3a00cee746535bd9817f31e97bcb0d (diff)
improved debug handlers (moved from common package)
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