// Trace adds a TRACE route > handler to the router.
223
func Trace(path string, h interface{}, m ...interface{}) {
	Default.Trace(path, h, m...)
}
1159855
func (q *Query) Trace(trace Tracer) *Query {
	q.trace = trace
	return q
}
1354950
func (s *Sensor) TracingHandler(name string, handler http.HandlerFunc) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		s.WithTracingContext(name, w, req, func(span ot.Span, ctx context.Context) {
			// Capture response code for span
			hooks := httpsnoop.Hooks{
				WriteHeader: func(next httpsnoop.WriteHeaderFunc) httpsnoop.WriteHeaderFunc {
					return func(code int) {
						next(code)
						span.SetTag(string(ext.HTTPStatusCode), code)
					}
				},
			}

			// Add hooks to response writer
			wrappedWriter := httpsnoop.Wrap(w, hooks)

			// Serve original handler
			handler.ServeHTTP(wrappedWriter, req.WithContext(ctx))
		})
	}
}
153007
func (s *Server) Tracer() ot.Tracer {
	if s.trace == nil {
		return nil
	}

	return s.trace.Tracer()
}
358894
func (r *SubRouter) PATCH(route string, handler interface{}) *SubRouter {
	route = r.prefixedRoute(route)
	if r.parent != nil {
		r.parent.handleReg(MethodPATCH, route, handler, r.prefixes)
	}

	return r
}
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))
	}
}
447641
func (r *Router) Patch(path string, fn http.HandlerFunc) *Router {
	return r.Method(http.MethodPatch, path, fn)
}
1261152
func (e *Entry) Trace(msg string) *Entry {
	e.Info(msg)
	v := e.WithFields(e.Fields)
	v.Message = msg
	v.start = time.Now()
	return v
}
545680
func (g *Group) Trace(path string, h HandlerFunc, opts ...HandlerOption) {
	g.add(path, h, opts, http.MethodTrace)
}
561720
func (r Req) TraceLog(span opentracing.Span) {
	span.LogFields(
		log.Object("key", r.MKey),
		log.String("target", r.Target),
		log.String("pattern", r.Pattern),
		log.Int("from", int(r.From)),
		log.Int("to", int(r.To)),
		log.Int("span", int(r.To-r.From-1)),
		log.Int("mdp", int(r.MaxPoints)),
		log.Int("rawInterval", int(r.RawInterval)),
		log.String("cons", r.Consolidator.String()),
		log.String("consReq", r.ConsReq.String()),
		log.Int("schemaId", int(r.SchemaId)),
		log.Int("aggId", int(r.AggId)),
		log.Int("archive", r.Archive),
		log.Int("archInterval", int(r.ArchInterval)),
		log.Int("TTL", int(r.TTL)),
		log.Int("outInterval", int(r.OutInterval)),
		log.Int("aggNum", int(r.AggNum)),
	)
}
1002837
func (r *Router) Patch(pattern string, handler http.HandlerFunc) {
	r.AddRoute(PATCH, pattern, handler)
}
528134
func (l *DefaultLogger) Trace(msg string, args ...interface{}) {
	l.Log(LevelTrace, msg, args)
}
1144319
func (ml *MockRouteCountLogger) TraceD(title string, data map[string]interface{}) {
	ml.logger.TraceD(title, data)
}
1230227
func (r *Router) Handle(path string, handler http.Handler) *Route {
	return r.NewRoute().Path(path).Handler(handler)
}
549030
func (l *Logger) Trace(msg string) *Entry {
	return NewEntry(l).Trace(msg)
}
248597
func trace(message string, err error) {
	pc := make([]uintptr, 10)
	runtime.Callers(2, pc)
	f := runtime.FuncForPC(pc[0])
	file, line := f.FileLine(pc[0])
	if err != nil {
		log.Printf("%s:%d %s: %s\n", file, line, f.Name(), err)
	} else {
		log.Printf("%s:%d %s: %s\n", file, line, f.Name(), message)
	}
}
331171
func (scope *Scope) trace(t time.Time) {
	if len(scope.SQL) > 0 {
		scope.db.slog(scope.SQL, t, scope.SQLVars...)
	}
}