// Trace adds the route to the router using the TRACE HTTP method.
342670
func (r *Route) Trace(handlers ...Handler) *Route {
	return r.group.add("TRACE", r.path, handlers)
}
49451
func (r *Router) Patch(pattern string, handlers ...Middleware) *Router {
	return r.Handle(http.MethodPatch, pattern, handlers...)
}
153007
func (s *Server) Tracer() ot.Tracer {
	if s.trace == nil {
		return nil
	}

	return s.trace.Tracer()
}
1287173
func (logger *Logger) Tracef(format string, args ...interface{}) {
	logger.log(TRACE, fmt.Sprintf(format, args...))
}
388871
func (s *Sensor) TracingHttpRequest(name string, parent, req *http.Request, client http.Client) (res *http.Response, err error) {
	var span ot.Span
	if parentSpan, ok := parent.Context().Value("parentSpan").(ot.Span); ok {
		span = s.tracer.StartSpan("client", ot.ChildOf(parentSpan.Context()))
	} else {
		span = s.tracer.StartSpan("client")
	}
	defer span.Finish()

	headersCarrier := ot.HTTPHeadersCarrier(req.Header)
	if err := s.tracer.Inject(span.Context(), ot.HTTPHeaders, headersCarrier); err != nil {
		return nil, err
	}

	res, err = client.Do(req.WithContext(context.Background()))

	span.SetTag(string(ext.SpanKind), string(ext.SpanKindRPCClientEnum))
	span.SetTag(string(ext.PeerHostname), req.Host)
	span.SetTag(string(ext.HTTPUrl), req.URL.String())
	span.SetTag(string(ext.HTTPMethod), req.Method)
	span.SetTag(string(ext.HTTPStatusCode), res.StatusCode)

	if err != nil {
		if e, ok := err.(error); ok {
			span.LogFields(otlog.Error(e))
		} else {
			span.LogFields(otlog.Object("error", err))
		}
	}
	return
}
1016688
func (logger *Logger) Trace(args ...interface{}) {
	logger.log(TRACE, fmt.Sprint(args...))
}
338117
func (r Route) Trace() string {
	printfmt := fmt.Sprintf("%s:", r.Method)
	if r.Subdomain != "" {
		printfmt += fmt.Sprintf(" %s", r.Subdomain)
	}
	printfmt += fmt.Sprintf(" %s ", r.Tmpl().Src)

	if l := r.RegisteredHandlersLen(); l > 1 {
		printfmt += fmt.Sprintf("-> %s() and %d more", r.MainHandlerName, l-1)
	} else {
		printfmt += fmt.Sprintf("-> %s()", r.MainHandlerName)
	}

	// printfmt := fmt.Sprintf("%s: %s >> %s", r.Method, r.Subdomain+r.Tmpl().Src, r.MainHandlerName)
	// if l := len(r.Handlers); l > 0 {
	// 	printfmt += fmt.Sprintf(" and %d more", l)
	// }
	return printfmt // without new line.
}
739178
func (r *Router) Patch(path string, fn interface{}) *Router {
	return r.addRoute(httpMethodPatch, path, fn)
}
538335
func (e *Error) Trace(fields ...string) *Error {
	if e == nil {
		return nil
	}

	e.lock.Lock()
	defer e.lock.Unlock()

	return e.trace(fields...)
}
610577
func Trace(
	parent context.Context,
	desc string) (ctx context.Context, report ReportFunc) {
	// If tracing is disabled, this is a no-op.
	if !*fEnabled {
		ctx = parent
		report = func(err error) {}
		return
	}

	// Is this context already being traced? If so, simply add a span.
	if parent.Value(traceStateKey) != nil {
		ctx, report = StartSpan(parent, desc)
		return
	}

	// Set up a new trace state.
	ts := new(traceState)
	baseReport := ts.CreateSpan(desc)

	// Log when finished.
	report = func(err error) {
		baseReport(err)
		ts.Log()
	}

	// Set up the context.
	ctx = context.WithValue(parent, traceStateKey, ts)

	return
}
181936
func (r *Router) PATCH(route string, handler interface{}) *Router {
	r.Handle(MethodPATCH, route, handler)
	return r
}
944100
func (r *Route) Patch(fn http.HandlerFunc) *Route {
	return r.Method(http.MethodPatch, fn)
}
700790
func (this *HttpClient) Trace(url string, params ...map[string]string) (*Response, error) {
	for _, p := range params {
		url = addParams(url, toUrlValues(p))
	}

	return this.Do("TRACE", url, nil, nil)
}
594182
func trace(ctx context.Context, subsystem, name string) (opentracing.Span, context.Context) {
	span, ctx := opentracing.StartSpanFromContext(ctx, name)

	span.SetTag("subsystem", subsystem)

	// This is slightly confusing: when tracing is disabled, trace spans
	// are still created - but the tracer used is a NOP. Therefore, only
	// display the message when tracing is really enabled.
	if tracing {
		agentLog.Debugf("created span %v", span)
	}

	return span, ctx
}
1002837
func (r *Router) Patch(pattern string, handler http.HandlerFunc) {
	r.AddRoute(PATCH, pattern, handler)
}
1106001
func Trace(format string, err error, fields logrus.Fields, a ...interface{}) {
	if traceEnabled {
		log.WithError(err).WithFields(fields).Debugf(format)
	}
}
1159855
func (q *Query) Trace(trace Tracer) *Query {
	q.trace = trace
	return q
}