MCPcopy
hub / github.com/go-gorm/gorm / log

Method log

logger/slog.go:96–108  ·  view source on GitHub ↗
(ctx context.Context, level slog.Level, msg string, args ...any)

Source from the content-addressed store, hash-verified

94}
95
96func (l *slogLogger) log(ctx context.Context, level slog.Level, msg string, args ...any) {
97 if ctx == nil {
98 ctx = context.Background()
99 }
100
101 if !l.Logger.Enabled(ctx, level) {
102 return
103 }
104
105 r := slog.NewRecord(time.Now(), level, msg, utils.CallerFrame().PC)
106 r.Add(args...)
107 _ = l.Logger.Handler().Handle(ctx, r)
108}
109
110// ParamsFilter filter params
111func (l *slogLogger) ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{}) {

Callers 4

InfoMethod · 0.95
WarnMethod · 0.95
ErrorMethod · 0.95
TraceMethod · 0.95

Calls 2

CallerFrameFunction · 0.92
AddMethod · 0.80

Tested by

no test coverage detected