lostisland / faraday

Simple, but flexible HTTP client library, with support for multiple backends.
https://lostisland.github.io/faraday
MIT License
5.74k stars 976 forks source link

Rename Faraday::Logger::Formatter#error to #exception #1468

Closed iMacTia closed 1 year ago

iMacTia commented 1 year ago

Description

Rename Faraday::Logger::Formatter#error to #exception This is because #error is already delegated to the internal Logger, and could cause an infinite loop when the log_level is set to "error".

Fixes #1467

Additional Notes

Although this is technically a breaking change, I'll still release this as a hotfix release (2.7.2) because of the following:

  1. The Middleware API is unchanged (on_error)
  2. The current implementation could cause infinite loops if the log_level is set to "error"
  3. The only affected projects will have a custom formatter implementing the error method. Considering this feature was released very recently, the chances of this happening are extremely small.

cc @epaew in case you've built a custom formatter following your PR