Closed maratori closed 2 months ago
slog doesn't catch the following common mistake
slog
err := errors.New("failed") // wrong logger.Error("Something went wrong", err) // "!BADKEY":"failed" // correct logger.Error("Something went wrong", "error", err) // "error":"failed"
err may be any type except slog.Attr. So ideally, need to validate any type. But the most common is error, and need to validate at least it.
err
slog.Attr
error
Hello,
Looks like it is already reported at https://github.com/golang/go/issues/65740 and about to get fixed.
slog
doesn't catch the following common mistakeerr
may be any type exceptslog.Attr
. So ideally, need to validate any type. But the most common iserror
, and need to validate at least it.