diff options
author | Wolfy-J <[email protected]> | 2018-09-10 16:42:15 +0400 |
---|---|---|
committer | GitHub <[email protected]> | 2018-09-10 16:42:15 +0400 |
commit | a554a98dda0d793da09db17314ef3977a2f3a465 (patch) | |
tree | 64b506898d283c39babc48da5a29df203cb57b49 /cmd/rr/http/debug.go | |
parent | ea97c188a4a74c00b585cb50fa1ed4db7d190e09 (diff) | |
parent | 46a06a4d104802fb4271e06da487f74f23edd10c (diff) |
Merge pull request #33 from spiral/feature/env-setterv1.2.0
Feature/env setter
Diffstat (limited to 'cmd/rr/http/debug.go')
-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)) + } + } + }) +} |