Comment

Comment by tastysandwich

I'm really glad they've introduced this, I just wish it also had the traditional formatting methods, eg Infof, Debugf, Errorf, etc, for backwards compatibility.

I've got a few packages that accept a basic logger interface, eg:

  type debugLogger interface {
      Debugf(format string, args ...any)
  }

  type MyThing struct {
    logger debugLogger
  }

  func New(logger debugLogger) *MyThing {
    return &MyThing{logger}
  }
I'd love to switch to slog but I'll have to v2 these packages now.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton