// Trace adds a TRACE route > handler to the router.
162930
func (e *Echo) Trace(path string, h interface{}, m ...interface{}) {
	e.add(TRACE, "", path, h, m...)
}
867260
func (dl *DefaultLogger) Trace(message string, params ...interface{}) {
	dl.logger.Tracef(message, params...)
}
49451
func (r *Router) Patch(pattern string, handlers ...Middleware) *Router {
	return r.Handle(http.MethodPatch, pattern, handlers...)
}
604075
func TraceHandler() gin.HandlerFunc {
	return func(ctx *gin.Context) {
		pprof.Trace(ctx.Writer, ctx.Request)
	}
}
593341
func (s *logger) Trace(description string, keysAndValues ...interface{}) {
	s.trace(1, description, keysAndValues...)
}
344134
func (s *Server) Trace(path string, h HandlerFunc, opts ...HandlerOption) {
	s.register(http.MethodTrace, path, h, opts...)
}
1070006
func (r *Router) Handle(method, pattern string, handler http.Handler) Route {
	var p string
	if pattern == "/" && r.pattern != "" {
		p = r.pattern
	} else {
		p = r.pattern + pattern
	}

	built := r.buildMiddlewares(handler)

	rm := r.root().hostrm.Register(r.host)
	rt := rm.Register(method, p, built)

	// If this route does not exist in this Router instance then add it
	if _, ok := r.findRoute(rt); !ok {
		rt.pattern = p
		rt.host = r.host
		rt.pathMatcher = rm
		r.routes = append(r.routes, rt)
	}
	return rt
}
1197525
func (m *Mux) Trace(pattern PatternType, handler HandlerType) {
	m.rt.handleUntyped(pattern, mTRACE, handler)
}
289589
func (r *Router) PATCH(path string, handlers ...HandlerFunc) {
	r.Handle("PATCH", path, handlers)
}
255797
func Trace(w http.ResponseWriter, r *http.Request) {
	sec, err := strconv.ParseFloat(r.FormValue("seconds"), 64)
	if sec <= 0 || err != nil {
		sec = 1
	}

	if durationExceedsWriteTimeout(r, sec) {
		w.Header().Set("Content-Type", "text/plain; charset=utf-8")
		w.Header().Set("X-Go-Pprof", "1")
		w.WriteHeader(http.StatusBadRequest)
		fmt.Fprintln(w, "profile duration exceeds server's WriteTimeout")
		return
	}

	// Set Content Type assuming trace.Start will work,
	// because if it does it starts writing.
	w.Header().Set("Content-Type", "application/octet-stream")
	if err := trace.Start(w); err != nil {
		// trace.Start failed, so no writes yet.
		// Can change header back to text content and send error code.
		w.Header().Set("Content-Type", "text/plain; charset=utf-8")
		w.Header().Set("X-Go-Pprof", "1")
		w.WriteHeader(http.StatusInternalServerError)
		fmt.Fprintf(w, "Could not enable tracing: %s\n", err)
		return
	}
	sleep(w, time.Duration(sec*float64(time.Second)))
	trace.Stop()
}
723175
func (e *Error) Trace() (s string) {
	for err := e; err != nil; err = err.next {
		s = s + fmt.Sprintln(err)
	}
	return
}
545680
func (g *Group) Trace(path string, h HandlerFunc, opts ...HandlerOption) {
	g.add(path, h, opts, http.MethodTrace)
}
1301636
func TraceR(req *http.Request, message string, data Data) {
	TraceC(GetRequestID(req), message, data)
}
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
}
269866
func (r *route) Handler(handler types.APIFunc) types.Route {
	r.handler = handler
	return r
}
1075814
func (dl *ConsoleLogger) Trace(message interface{}, params ...interface{}) {
	dl.logger.Tracef(fmt.Sprintf("%s %s", caller(), fmt.Sprint(message)), params...)
}
1013392
func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handle {
	if r.instrh != nil {
		// This needs to be outside the closure to avoid data race when reading and writing to 'h'.
		h = r.instrh(handlerName, h)
	}
	return func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()

		for _, p := range params {
			ctx = context.WithValue(ctx, param(p.Key), p.Value)
		}
		h(w, req.WithContext(ctx))
	}
}