Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func LogPayloads(opts ...LogPayloadsOption) func(goa.Endpoint) goa.Endpoint {
reqKey = "client-" + reqKey
resKey = "client-" + resKey
}
return func(ctx context.Context, req interface{}) (interface{}, error) {
return func(ctx context.Context, req any) (any, error) {
if !log.DebugEnabled(ctx) {
return next(ctx, req)
}
Expand Down
2 changes: 1 addition & 1 deletion debug/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestDebugPayloads(t *testing.T) {
newDebugLogContext := func() context.Context {
return log.Context(newLogContext(), log.WithDebug())
}
formatTest := func(_ context.Context, a interface{}) string {
formatTest := func(_ context.Context, a any) string {
return "test"
}

Expand Down
6 changes: 3 additions & 3 deletions debug/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
func UnaryServerInterceptor() grpc.UnaryServerInterceptor {
return func(
ctx context.Context,
req interface{},
req any,
_ *grpc.UnaryServerInfo,
handler grpc.UnaryHandler,
) (interface{}, error) {
) (any, error) {
if debugLogs {
ctx = log.Context(ctx, log.WithDebug())
} else {
Expand All @@ -33,7 +33,7 @@ func UnaryServerInterceptor() grpc.UnaryServerInterceptor {
// in conjunction with the MountDebugLogEnabler function.
func StreamServerInterceptor() grpc.StreamServerInterceptor {
return func(
srv interface{},
srv any,
stream grpc.ServerStream,
_ *grpc.StreamServerInfo,
handler grpc.StreamHandler,
Expand Down
4 changes: 2 additions & 2 deletions debug/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type (

// FormatFunc is used to format the logged value for payloads and
// results.
FormatFunc func(context.Context, interface{}) string
FormatFunc func(context.Context, any) string

lpOptions struct {
maxsize int // maximum number of bytes in a single log message or value
Expand Down Expand Up @@ -107,7 +107,7 @@ func WithOffValue(offval string) DebugLogEnablerOption {
}

// FormatJSON returns a function that formats the given value as JSON.
func FormatJSON(_ context.Context, v interface{}) string {
func FormatJSON(_ context.Context, v any) string {
js, err := json.Marshal(v)
if err != nil {
return fmt.Sprintf("<invalid: %s>", err)
Expand Down
12 changes: 12 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,20 @@ go.opentelemetry.io/contrib/detectors/gcp v1.35.0/go.mod h1:qGWP8/+ILwMRIUf9uIVL
go.opentelemetry.io/contrib/detectors/gcp v1.36.0/go.mod h1:IbBN8uAIIx734PTonTPxAxnjc2pQTxWNkwfstZ+6H2k=
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4=
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU=
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY=
go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ=
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4=
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
Expand All @@ -651,6 +656,7 @@ golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+Zdx
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
Expand All @@ -662,6 +668,7 @@ golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
Expand All @@ -676,13 +683,15 @@ golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk=
golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0=
golang.org/x/telemetry v0.0.0-20250710130107-8d8967aff50b/go.mod h1:4ZwOYna0/zsOKwuR5X/m0QFOJpSZvAxFfkQT+Erd9D4=
Expand All @@ -694,13 +703,15 @@ golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc h1:Nf+EdcTLHR8qDNN/KfkQL0u0ssxt9OhbaWCl5C0ucEI=
Expand Down Expand Up @@ -743,6 +754,7 @@ google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
google.golang.org/grpc/examples v0.0.0-20230224211313-3775f633ce20/go.mod h1:Nr5H8+MlGWr5+xX/STzdoEqJrO+YteqFbMyCsrb6mH0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
Expand Down
26 changes: 13 additions & 13 deletions log/adapt.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,53 +96,53 @@ func ToLogrSink(ctx context.Context) *LogrSink {
}

// Fatal is equivalent to l.Print() followed by a call to os.Exit(1).
func (l *StdLogger) Fatal(v ...interface{}) {
func (l *StdLogger) Fatal(v ...any) {
l.Print(v...)
osExit(1)
}

// Fatalf is equivalent to l.Printf() followed by a call to os.Exit(1).
func (l *StdLogger) Fatalf(format string, v ...interface{}) {
func (l *StdLogger) Fatalf(format string, v ...any) {
l.Printf(format, v...)
osExit(1)
}

// Fatalln is equivalent to l.Println() followed by a call to os.Exit(1).
func (l *StdLogger) Fatalln(v ...interface{}) {
func (l *StdLogger) Fatalln(v ...any) {
l.Println(v...)
osExit(1)
}

// Panic is equivalent to l.Print() followed by a call to panic().
func (l *StdLogger) Panic(v ...interface{}) {
func (l *StdLogger) Panic(v ...any) {
l.Print(v...)
panic(fmt.Sprint(v...))
}

// Panicf is equivalent to l.Printf() followed by a call to panic().
func (l *StdLogger) Panicf(format string, v ...interface{}) {
func (l *StdLogger) Panicf(format string, v ...any) {
l.Printf(format, v...)
panic(fmt.Sprintf(format, v...))
}

// Panicln is equivalent to l.Println() followed by a call to panic().
func (l *StdLogger) Panicln(v ...interface{}) {
func (l *StdLogger) Panicln(v ...any) {
l.Println(v...)
panic(fmt.Sprintln(v...))
}

// Print print to the logger. Arguments are handled in the manner of fmt.Print.
func (l *StdLogger) Print(v ...interface{}) {
func (l *StdLogger) Print(v ...any) {
Printf(l.ctx, "%s", fmt.Sprint(v...))
}

// Printf prints to the logger. Arguments are handled in the manner of fmt.Printf.
func (l *StdLogger) Printf(format string, v ...interface{}) {
func (l *StdLogger) Printf(format string, v ...any) {
Printf(l.ctx, format, v...)
}

// Println prints to the logger. Arguments are handled in the manner of fmt.Println.
func (l *StdLogger) Println(v ...interface{}) {
func (l *StdLogger) Println(v ...any) {
Printf(l.ctx, "%s", fmt.Sprintln(v...))
}

Expand All @@ -165,7 +165,7 @@ func (l *LogrSink) Enabled(level int) bool {
return true
}

func (l *LogrSink) Info(level int, msg string, keysAndValues ...interface{}) {
func (l *LogrSink) Info(level int, msg string, keysAndValues ...any) {
kvs := make([]KV, len(keysAndValues)/2+1)
kvs[0] = KV{K: "msg", V: msg}
for i := 0; i < len(keysAndValues); i += 2 {
Expand All @@ -178,7 +178,7 @@ func (l *LogrSink) Info(level int, msg string, keysAndValues ...interface{}) {
}
}

func (l *LogrSink) Error(err error, msg string, keysAndValues ...interface{}) {
func (l *LogrSink) Error(err error, msg string, keysAndValues ...any) {
kvs := make([]KV, len(keysAndValues)/2+1)
kvs[0] = KV{K: "msg", V: msg}
for i := 0; i < len(keysAndValues); i += 2 {
Expand Down Expand Up @@ -207,13 +207,13 @@ func (l *LogrSink) WithName(name string) logr.LogSink {
}

// Log creates a log entry using a sequence of key/value pairs.
func (l goaLogger) Log(keyvals ...interface{}) error {
func (l goaLogger) Log(keyvals ...any) error {
n := (len(keyvals) + 1) / 2
if len(keyvals)%2 != 0 {
keyvals = append(keyvals, "MISSING")
}
kvs := make([]KV, n)
for i := 0; i < n; i++ {
for i := range n {
k, v := keyvals[2*i], keyvals[2*i+1]
kvs[i] = KV{K: fmt.Sprint(k), V: v}
}
Expand Down
4 changes: 2 additions & 2 deletions log/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type (
// booleans, nil or a slice of these types.
KV struct {
K string
V interface{}
V any
}

// Fielder is an interface that will return a slice of KV
Expand All @@ -15,7 +15,7 @@ type (

// Fields allows to quickly define fields for cases where you are OK with
// non-deterministic order of the fields
Fields map[string]interface{}
Fields map[string]any

kvList []KV
)
Expand Down
2 changes: 1 addition & 1 deletion log/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func appendJSONString(b []byte, s string) []byte {
return append(b, '"')
}

func appendJSONArray(b []byte, arr []interface{}) []byte {
func appendJSONArray(b []byte, arr []any) []byte {
b = append(b, '[')
for i, v := range arr {
if i > 0 {
Expand Down
4 changes: 2 additions & 2 deletions log/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func TestFormat(t *testing.T) {
{"sliceFloat32", []float32{7, 7}},
{"sliceFloat64", []float64{8.1, 8.1}},
{"sliceBool", []bool{true, false, true}},
{"sliceNil", []interface{}{nil, nil, nil}},
{"sliceMix", []interface{}{"a", 1, true, nil}},
{"sliceNil", []any{nil, nil, nil}},
{"sliceMix", []any{"a", 1, true, nil}},
}

formattedKeyVals := "string=val " +
Expand Down
8 changes: 4 additions & 4 deletions log/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ func UnaryServerInterceptor(logCtx context.Context, opts ...GRPCLogOption) grpc.

return func(
ctx context.Context,
req interface{},
req any,
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler,
) (interface{}, error) {
) (any, error) {
ctx = WithContext(ctx, logCtx)
if !o.disableCallID {
ctx = With(ctx, KV{RequestIDKey, shortID()})
Expand Down Expand Up @@ -101,7 +101,7 @@ func StreamServerInterceptor(logCtx context.Context, opts ...GRPCLogOption) grpc
}

return func(
srv interface{},
srv any,
stream grpc.ServerStream,
info *grpc.StreamServerInfo,
handler grpc.StreamHandler,
Expand Down Expand Up @@ -151,7 +151,7 @@ func UnaryClientInterceptor(opts ...GRPCLogOption) grpc.UnaryClientInterceptor {
return func(
ctx context.Context,
fullmethod string,
req, reply interface{},
req, reply any,
cc *grpc.ClientConn,
invoker grpc.UnaryInvoker,
opts ...grpc.CallOption,
Expand Down
2 changes: 1 addition & 1 deletion log/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func HTTP(logCtx context.Context, opts ...HTTPLogOption) func(http.Handler) http
// Endpoint is a Goa endpoint middleware that adds the service and method names
// to the logged key/value pairs.
func Endpoint(e goa.Endpoint) goa.Endpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return func(ctx context.Context, req any) (any, error) {
if s := ctx.Value(goa.ServiceKey); s != nil {
ctx = With(ctx, KV{K: GoaServiceKey, V: s})
}
Expand Down
2 changes: 1 addition & 1 deletion log/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestEndpoint(t *testing.T) {
now := timeNow
timeNow = func() time.Time { return time.Date(2022, time.January, 9, 20, 29, 45, 0, time.UTC) }
defer func() { timeNow = now }()
endpoint := func(ctx context.Context, _ interface{}) (interface{}, error) {
endpoint := func(ctx context.Context, _ any) (any, error) {
Printf(ctx, "test")
return nil, nil
}
Expand Down
12 changes: 6 additions & 6 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Debug(ctx context.Context, keyvals ...Fielder) {

// Debugf sets the key MessageKey (default "msg") and calls Debug. Arguments
// are handled in the manner of fmt.Printf.
func Debugf(ctx context.Context, format string, v ...interface{}) {
func Debugf(ctx context.Context, format string, v ...any) {
Debug(ctx, KV{MessageKey, fmt.Sprintf(format, v...)})
}

Expand All @@ -68,7 +68,7 @@ func Print(ctx context.Context, keyvals ...Fielder) {

// Printf sets the key MessageKey (default "msg") and calls Print. Arguments
// are handled in the manner of fmt.Printf.
func Printf(ctx context.Context, format string, v ...interface{}) {
func Printf(ctx context.Context, format string, v ...any) {
Print(ctx, KV{MessageKey, fmt.Sprintf(format, v...)})
}

Expand All @@ -80,7 +80,7 @@ func Info(ctx context.Context, keyvals ...Fielder) {

// Infof sets the key MessageKey (default "msg") and calls Info. Arguments are
// handled in the manner of fmt.Printf.
func Infof(ctx context.Context, format string, v ...interface{}) {
func Infof(ctx context.Context, format string, v ...any) {
Info(ctx, KV{MessageKey, fmt.Sprintf(format, v...)})
}

Expand All @@ -92,7 +92,7 @@ func Warn(ctx context.Context, keyvals ...Fielder) {

// Warnf sets the key MessageKey (default "msg") and calls Warn. Arguments are
// handled in the manner of fmt.Printf.
func Warnf(ctx context.Context, format string, v ...interface{}) {
func Warnf(ctx context.Context, format string, v ...any) {
Warn(ctx, KV{MessageKey, fmt.Sprintf(format, v...)})
}

Expand All @@ -112,7 +112,7 @@ func Error(ctx context.Context, err error, keyvals ...Fielder) {

// Errorf sets the key MessageKey (default "msg") and calls Error. Arguments
// are handled in the manner of fmt.Printf.
func Errorf(ctx context.Context, err error, format string, v ...interface{}) {
func Errorf(ctx context.Context, err error, format string, v ...any) {
Error(ctx, err, KV{MessageKey, fmt.Sprintf(format, v...)})
}

Expand All @@ -123,7 +123,7 @@ func Fatal(ctx context.Context, err error, keyvals ...Fielder) {
}

// Fatalf is equivalent to Errorf followed by a call to os.Exit(1)
func Fatalf(ctx context.Context, err error, format string, v ...interface{}) {
func Fatalf(ctx context.Context, err error, format string, v ...any) {
Fatal(ctx, err, KV{MessageKey, fmt.Sprintf(format, v...)})
}

Expand Down
Loading
Loading