Skip to content

Commit

Permalink
fix removal of debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Day committed Dec 22, 2017
1 parent afeff3e commit bea89ce
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
5 changes: 0 additions & 5 deletions core/tracer.go
Expand Up @@ -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
Expand Down
31 changes: 25 additions & 6 deletions glide.lock

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

2 changes: 0 additions & 2 deletions glide.yaml
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions global.go
Expand Up @@ -3,20 +3,20 @@ 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
// must not be updated when there is an active tracer using it. This is an alias
// 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{})
}

Expand Down
10 changes: 5 additions & 5 deletions http.go
Expand Up @@ -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)
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand All @@ -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)))

}
Expand Down

0 comments on commit bea89ce

Please sign in to comment.