phoenixframework / phoenix_live_reload

Provides live-reload functionality for Phoenix
MIT License
315 stars 90 forks source link

Warning during compilation on Elixir 1.15.x #137

Closed crbelaus closed 1 year ago

crbelaus commented 1 year ago

When compiling Phoenix Live Reload on Elixir 1.15 or higher I get a warning because it is calling the deprecated Logger.warn/2 function.

==> phoenix_live_reload
Compiling 4 files (.ex)
warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
  (phoenix_live_reload 1.4.1) lib/phoenix_live_reload/application.ex:32: Phoenix.LiveReloader.Application.start_link/0

Generated phoenix_live_reload app

I was going to open a PR to replace Logger.warn/2 with Logger.warning/2 but it is only available from Elixir 1.11 and Phoenix Live Reload supports Elixir 1.6, so not sure how to proceed selecting the right function call depending on the Elixir version.

EDIT: I saw that plug_cowboy was updated to require Elixir 1.11 at least. Would that be an acceptable solution here as well?

chrismccord commented 1 year ago

Yeah that's fine. Please send a PR!

josevalim commented 1 year ago

Yes, we can bump the requirement as long as we release a new minor version.

crbelaus commented 1 year ago

Thanks for the feedback. I've just pushed a pull request that fixes the warnings.