From bea89ce3d0acbd161629256ff7fac30526a16fbe Mon Sep 17 00:00:00 2001 From: Andy Day Date: Thu, 21 Dec 2017 16:23:27 -0800 Subject: [PATCH] fix removal of debug --- core/tracer.go | 5 ----- glide.lock | 31 +++++++++++++++++++++++++------ glide.yaml | 2 -- global.go | 10 +++++----- http.go | 10 +++++----- 5 files changed, 35 insertions(+), 23 deletions(-) diff --git a/core/tracer.go b/core/tracer.go index fda1721..f2c7288 100644 --- a/core/tracer.go +++ b/core/tracer.go @@ -9,11 +9,6 @@ import ( opentracing "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/log" - godebug "github.com/tj/go-debug" -) - -var ( - debug = godebug.Debug("ctrace-core") ) // Tracer is a simple, thin interface for Span creation and SpanContext diff --git a/glide.lock b/glide.lock index 0602b84..f41c5f7 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 0272b9d9c919988827d27c4182b29475da9a999d0ed17dfefb850404a843ea52 -updated: 2017-06-16T08:06:43.661824152-07:00 +hash: fe7f8689be0826395bf021f24709bc143b73a0f00f43628a37eab121ee287909 +updated: 2017-12-21T16:23:13.237417631-08:00 imports: - name: github.com/eawsy/aws-lambda-go-core version: e26eed6aa244a3d45aa693816a9c5faf39390fcd @@ -17,12 +17,13 @@ imports: subpackages: - http - log -- name: github.com/tj/go-debug - version: ff4a55a20a86994118644bbddc6a216da193cc13 - name: golang.org/x/net version: ddf80d0970594e2e4cccf5a98861cad3d9eaa4cd subpackages: - context + - html + - html/atom + - html/charset testImports: - name: github.com/axw/gocov version: 3a69a0d2a4ef1f263e2d92b041a69593d6964fe8 @@ -35,7 +36,7 @@ testImports: - name: github.com/mattn/goveralls version: a2cbbd7cdce4f5e051016fedf639c64bb05ef031 - name: github.com/onsi/ginkgo - version: 77a8c1e5c40d6bb6c5eb4dd4bdce9763564f6298 + version: 9eda700730cba42af70d53180f9dcce9266bc2bc subpackages: - config - internal/codelocation @@ -55,7 +56,7 @@ testImports: - reporters/stenographer/support/go-isatty - types - name: github.com/onsi/gomega - version: 334b8f472b3af5d541c5642701c1e29e2126f486 + version: c893efa28eb45626cdaa76c9f653b62488858837 subpackages: - format - internal/assertion @@ -78,6 +79,24 @@ testImports: version: fb4cac33e3196ff7f507ab9b2d2a44b0142f5b5a subpackages: - unix +- name: golang.org/x/text + version: 825fc78a2fd6fa0a5447e300189e3219e05e1f25 + subpackages: + - encoding + - encoding/charmap + - encoding/htmlindex + - encoding/internal + - encoding/internal/identifier + - encoding/japanese + - encoding/korean + - encoding/simplifiedchinese + - encoding/traditionalchinese + - encoding/unicode + - internal/tag + - internal/utf8internal + - language + - runes + - transform - name: golang.org/x/tools version: 34f7837286c0bd1ea0d50c06fbf585a7090dbd4e subpackages: diff --git a/glide.yaml b/glide.yaml index dce1bfc..2d001b8 100644 --- a/glide.yaml +++ b/glide.yaml @@ -10,8 +10,6 @@ import: - service/lambda/runtime - service/lambda/runtime/event/apigatewayproxyevt - package: github.com/eawsy/aws-lambda-go-core -- package: github.com/tj/go-debug - version: ^2.0.0 testImport: - package: github.com/onsi/ginkgo version: ^1.2.0 diff --git a/global.go b/global.go index 6394577..8039cd3 100644 --- a/global.go +++ b/global.go @@ -3,7 +3,7 @@ package ctrace import ( "github.com/Nordstrom/ctrace-go/core" opentracing "github.com/opentracing/opentracing-go" - godebug "github.com/tj/go-debug" + // godebug "github.com/tj/go-debug" ) // TracerOptions allows creating a customized Tracer via NewWithOptions. The object @@ -11,12 +11,12 @@ import ( // of core.TracerOptions. type TracerOptions core.TracerOptions -var ( - debug = godebug.Debug("ctrace") -) +// var ( +// debug = godebug.Debug("ctrace") +// ) func init() { - debug("Initializing ctrace...") // start with empty line for testing + // debug("Initializing ctrace...") // start with empty line for testing Init(TracerOptions{}) } diff --git a/http.go b/http.go index dee83c8..c6225f8 100644 --- a/http.go +++ b/http.go @@ -42,7 +42,7 @@ type closeTracker struct { } func (c closeTracker) Close() error { - debug("Closing Response Writer...") + // debug("Closing Response Writer...") err := c.ReadCloser.Close() if err != nil { c.sp.SetTag(ext.ErrorKey, true) @@ -70,7 +70,7 @@ func (t *tracedHTTPClientTransport) RoundTrip( r *http.Request, ) (*http.Response, error) { op := r.Method + ":" + r.URL.Path - debug("Starting client RoundTrip: op=%s", op) + // debug("Starting client RoundTrip: op=%s", op) config := optioniallyInterceptHTTP(t.interceptor, r) opts := []opentracing.StartSpanOption{ @@ -170,7 +170,7 @@ func (i *responseInterceptor) WriteHeader(code int) { } func (i *responseInterceptor) Write(b []byte) (int, error) { - debug("Writing response body %s", string(b)) + // debug("Writing response body %s", string(b)) r, e := i.writer.Write(b) if !i.headerWritten { @@ -225,7 +225,7 @@ func TracedHTTPHandler( if len(config.Tags) > 0 { opts = append(opts, config.Tags...) } - debug("TracedHttpHandler: StartSpan(%s)", op) + // debug("TracedHttpHandler: StartSpan(%s)", op) span := tracer.StartSpan(op, opts...) ctx := span.Context() @@ -241,7 +241,7 @@ func TracedHTTPHandler( ri.parentCtx = parentCtx.(core.SpanContext) } - debug("TracedHttpHandler: ServeHTTP(...)") + // debug("TracedHttpHandler: ServeHTTP(...)") h.ServeHTTP(&ri, r.WithContext(ContextWithSpan(r.Context(), span))) }