Avoid interpolating errors into log message
Avoid interpolating errors into log message

HTTP error strings frequently contain messy details like "readfrom tcp 10.1.2.3:80->10.100.200.200:12345: http: read on closed response body". By including this in the log message it makes it much harder to correlate events and filter them in/out at once in our logging and errortracking system.

Slog automatically [1] extracts the first param of type err and structures it in the slog event in Event.Error, which makes it available to downstream systems as a more structured error.

[1]: https://github.com/monzo/slog/blob/f7973b45249deb99919c566aba9fcea211f3d10a/event.go#L118

monzo/typhon