MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Trace

Method Trace

api/pkg/telemetry/gorm_logger.go:42–54  ·  view source on GitHub ↗
(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

Source from the content-addressed store, hash-verified

40}
41
42func (gorm *gormLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
43 elapsed := time.Since(begin)
44 l := gorm.logger.WithSpan(gorm.tracer.Span(ctx).SpanContext()).WithString("latency", elapsed.String())
45 sql, rows := fc()
46 msg := fmt.Sprintf("[ROWS:%d][%s]", rows, sql)
47
48 if err != nil {
49 l.Error(stacktrace.Propagate(err, msg))
50 return
51 }
52
53 l.Debug(msg)
54}

Callers

nothing calls this directly

Calls 6

WithStringMethod · 0.65
WithSpanMethod · 0.65
SpanMethod · 0.65
ErrorMethod · 0.65
DebugMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected