Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviazhang0809 committed Mar 14, 2018
1 parent ff27b7e commit 6a832e9
Show file tree
Hide file tree
Showing 37 changed files with 26 additions and 37 deletions.
2 changes: 1 addition & 1 deletion 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,6 +131,7 @@ func (h *{{$handlerName}}) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}
{{if ne .RequestType ""}}
// TODO: potential perf issue, use zap.Object lazy serialization
zfields = append(zfields, zap.String("body", requestBody.String()))
{{- end -}}

Expand All @@ -144,7 +145,6 @@ func (h *{{$handlerName}}) HandleRequest(
zfields = append(zfields, zap.String("{{$k}}", headerValue))
}
{{- end}}
// TODO: potential perf issue, use zap.Object lazy serialization
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := {{$workflow}}{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func (h *BarArgNotStructHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", requestBody.String()))
// TODO: potential perf issue, use zap.Object lazy serialization
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 @@ -90,14 +90,14 @@ func (h *BarArgWithHeadersHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

// TODO: potential perf issue, use zap.Object lazy serialization
zfields = append(zfields, zap.String("body", requestBody.String()))
var headerOk bool
var headerValue string
headerValue, headerOk = req.Header.Get("X-Uuid")
if headerOk {
zfields = append(zfields, zap.String("X-Uuid", headerValue))
}
// TODO: potential perf issue, use zap.Object lazy serialization
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarArgWithHeadersEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", requestBody.String()))
// TODO: potential perf issue, use zap.Object lazy serialization
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 @@ -156,8 +156,8 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", requestBody.String()))
// TODO: potential perf issue, use zap.Object lazy serialization
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 @@ -87,8 +87,8 @@ func (h *BarArgWithParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", requestBody.String()))
// TODO: potential perf issue, use zap.Object lazy serialization
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 @@ -84,8 +84,8 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", requestBody.String()))
// TODO: potential perf issue, use zap.Object lazy serialization
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 @@ -98,6 +98,7 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

// TODO: potential perf issue, use zap.Object lazy serialization
zfields = append(zfields, zap.String("body", requestBody.String()))
var headerOk bool
var headerValue string
Expand All @@ -109,7 +110,6 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest(
if headerOk {
zfields = append(zfields, zap.String("X-Uuid", headerValue))
}
// TODO: potential perf issue, use zap.Object lazy serialization
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarArgWithQueryParamsEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (h *BarHelloWorldHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

// TODO: potential perf issue, use zap.Object lazy serialization
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarHelloWorldEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func (h *BarMissingArgHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

// TODO: potential perf issue, use zap.Object lazy serialization
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarMissingArgEndpoint{
Expand Down
1 change: 0 additions & 1 deletion codegen/test_data/endpoints/bar_bar_method_norequest.gogen
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func (h *BarNoRequestHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

// TODO: potential perf issue, use zap.Object lazy serialization
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarNoRequestEndpoint{
Expand Down
2 changes: 1 addition & 1 deletion codegen/test_data/endpoints/bar_bar_method_normal.gogen
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ func (h *BarNormalHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

zfields = append(zfields, zap.String("body", requestBody.String()))
// TODO: potential perf issue, use zap.Object lazy serialization
zfields = append(zfields, zap.String("body", requestBody.String()))
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarNormalEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func (h *BarTooManyArgsHandler) HandleRequest(
zap.String("endpoint", h.endpoint.EndpointName),
}

// TODO: potential perf issue, use zap.Object lazy serialization
zfields = append(zfields, zap.String("body", requestBody.String()))
var headerOk bool
var headerValue string
Expand All @@ -98,7 +99,6 @@ func (h *BarTooManyArgsHandler) HandleRequest(
if headerOk {
zfields = append(zfields, zap.String("X-Uuid", headerValue))
}
// TODO: potential perf issue, use zap.Object lazy serialization
req.Logger.Debug("Endpoint request to downstream", zfields...)

workflow := BarTooManyArgsEndpoint{
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.

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 6a832e9

Please sign in to comment.