Skip to content

Commit

Permalink
Merge pull request #79 from checkr/zz/fix-http-path
Browse files Browse the repository at this point in the history
Fix http path context and fix logging noise
  • Loading branch information
zhouzhuojie authored May 28, 2020
2 parents 6f8bb08 + 69c9266 commit 68fadf5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions handle_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (a ActionSendHTTP) Perform(ctx Context) error {
}

request := gorequest.New().
SetDebug(true).
SetLogger(newOmLogger(ctx)).
CustomMethod(a.Method, urlStr)

Expand Down
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (om *OpenMock) startHTTP() {
HTTPContext: ec,
HTTPHeader: ec.Request().Header,
HTTPBody: string(body),
HTTPPath: ec.Path(),
HTTPPath: ec.Request().URL.String(),
HTTPQueryString: ec.QueryString(),
om: om,
}
Expand Down
5 changes: 1 addition & 4 deletions openmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package openmock

import (
"log"
"os"

"github.com/caarlos0/env"
"github.com/goombaio/orderedmap"
Expand Down Expand Up @@ -82,8 +81,7 @@ func (om *OpenMock) SetupLogrus() {
logrus.WithField("err", err).Fatalf("failed to set logrus level:%s", om.LogLevel)
}
logrus.SetLevel(l)
logrus.SetOutput(os.Stdout)
logrus.SetReportCaller(true)
logrus.SetFormatter(&logrus.JSONFormatter{})
}

func (om *OpenMock) SetupRepo() {
Expand All @@ -101,7 +99,6 @@ func (om *OpenMock) SetupRepo() {
func (om *OpenMock) Start() {
om.SetupLogrus()
om.SetupRepo()

om.SetRedis()

err := om.Load()
Expand Down

0 comments on commit 68fadf5

Please sign in to comment.