diff options
Diffstat (limited to 'cmd/rr/http')
-rw-r--r-- | cmd/rr/http/debug.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cmd/rr/http/debug.go b/cmd/rr/http/debug.go new file mode 100644 index 00000000..f69e10a8 --- /dev/null +++ b/cmd/rr/http/debug.go @@ -0,0 +1,20 @@ +package http + +import ( + rr "github.com/spiral/roadrunner/cmd/rr/cmd" + + "github.com/spf13/cobra" + "github.com/spiral/roadrunner/cmd/rr/debug" + "github.com/spiral/roadrunner/service/http" +) + +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)) + } + } + }) +} |