Hi!
I've been playing around with the new slog package, and I noticed that it was missing formatter funcs (Infof, Errorf, etc). I'm interested in adding these, but I wasn't sure if this was done intentionally since the godoc
calls out this type of functionality in examples.
Helpers have been suggested as a workaround for this, but this is common enough behavior for me that I think it'd be very helpful to have upstream to make it easy to do things like: slog.Errorf("error calling func: %v", err)
Rough idea would be do expose formatter functions in the
Logger, with the tradeoff that you replace formatter args for Attr args:
```go
func (l *Logger) Errorf(format string, args ...any) {
l.log(context.Background(), LevelError, fmt.Sprintf(msg, args...))
}
func (l *Logger) ErrorContextf(ctx context.Background(ctx context.Context, format string, args ...any) {
l.log(ctx, LevelError, fmt.Sprintf(msg, args...))
}
```
I wanted to check in before I opened an issue! 🙏
Let me know if this makes sense, or if there's context I'm missing.
Thanks!