elixir-waffle / waffle_ecto

Waffle.Ecto provides an integration with Waffle and Ecto
https://hexdocs.pm/waffle_ecto
112 stars 30 forks source link

Make Logger optional #46

Open scollon42 opened 1 year ago

scollon42 commented 1 year ago

In this PR I wanted to introduce the possibility to swap the Logger implementation so that users can decide how WaffleEcto will log potential errors.

Having error log from an external library is not always wanted in production project and some might want to have control over that.

This PR gives now the ability to disable the error logs by adding this to a config file

config :waffle_ecto, :log_adapter, WaffleEcto.Logger.None

Note : I wanted to go the extra mile and add make this extendable using @callback instead of just adding a boolean to enable, disabled log. I think it might be useful but it also add more bit more code and I don't know if it will be used for anything else than disabling / enabling the log so.. 😄