News for hackers. Stuff that matters.
Re:Show HN: WAL Implementation in Golang by arp242 on Tuesday July 09, 2024 @01:56AM (#40912893)
What if I don't use zap?

Ideally you want to add an option via a function or interface:

  func New(optOne bool, log func(string, ...any)) {
    if log == nil {
        log = func(m string, a ...any) { fmt.Printf(m, a...) }
    }
    log("starting; optOne=%v", optOne)
  }
Or something along those lines.
Re:Show HN: WAL Implementation in Golang by philosopher1234 on Tuesday July 09, 2024 @02:11AM (#40912964)
This is what log/slog is for!
Re:Show HN: WAL Implementation in Golang by arp242 on Tuesday July 09, 2024 @03:29PM (#40919994)
What if I don't use slog?
Re:Show HN: WAL Implementation in Golang by derekperkins on Tuesday July 09, 2024 @11:17PM (#40923381)
Change and use slog with the zap adapter