Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviazhang0809 committed Mar 14, 2018
1 parent 47d6471 commit c003657
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 51 deletions.
4 changes: 2 additions & 2 deletions codegen/template_bundle/template_files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/templates/endpoint.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (h *{{$handlerName}}) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}
{{if ne .RequestType ""}}
zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
{{- end -}}

{{if (ne (len $reqHeaderMapKeys) 0) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/zap"
Expand Down Expand Up @@ -82,7 +81,7 @@ func (h *BarArgNotStructHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarArgNotStructEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/thriftrw/ptr"
Expand Down Expand Up @@ -91,7 +90,7 @@ func (h *BarArgWithHeadersHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
var headerOk bool
var headerValue string
headerValue, headerOk = req.Header.Get("X-Uuid")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/thriftrw/ptr"
Expand Down Expand Up @@ -213,7 +212,7 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarArgWithManyQueryParamsEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/thriftrw/ptr"
Expand Down Expand Up @@ -157,7 +156,7 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarArgWithNestedQueryParamsEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/zap"
Expand Down Expand Up @@ -88,7 +87,7 @@ func (h *BarArgWithParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarArgWithParamsEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/thriftrw/ptr"
Expand Down Expand Up @@ -85,7 +84,7 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarArgWithQueryHeaderEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/thriftrw/ptr"
Expand Down Expand Up @@ -99,7 +98,7 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
var headerOk bool
var headerValue string
headerValue, headerOk = req.Header.Get("X-Token")
Expand Down
3 changes: 1 addition & 2 deletions codegen/test_data/endpoints/bar_bar_method_normal.gogen
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/zap"
Expand Down Expand Up @@ -91,7 +90,7 @@ func (h *BarNormalHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarNormalEndpoint{
Expand Down
3 changes: 1 addition & 2 deletions codegen/test_data/endpoints/bar_bar_method_toomanyargs.gogen
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package barendpoint

import (
"context"
"fmt"

zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/zap"
Expand Down Expand Up @@ -88,7 +87,7 @@ func (h *BarTooManyArgsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", fmt.Sprintf("%#v", requestBody)))
zfields = append(zfields, zap.String("body", requestBody.String()))
var headerOk bool
var headerValue string
headerValue, headerOk = req.Header.Get("X-Token")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c003657

Please sign in to comment.